473,396 Members | 1,968 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Programming error

I'm a newbie to programming and am doing this project using linux and an error message keeps popping up and i've tried everything but cannot get it fixed and compiled. Please help, its due today!

Program is:

Expand|Select|Wrap|Line Numbers
  1.   /**
  2. File name: Lab 03;
  3. Name: George Michael;
  4. Date: 3/21/08;
  5. Purpose: To learn how to compile;
  6.   **/
  7.  
  8.  
  9.  
  10. #include<stdio.h>
  11.  
  12.  
  13. {
  14.       (int my_age;  /* users age */);
  15.  
  16.  
  17.  
  18.   printf("wlcome to lab03, we will learn how to compile today \n");
  19.   printf("Enter your age: ");
  20.   scanf("%d";"&my_age");
  21.   Printf("your age is %d","\n,my_age");
  22.  
  23.  
  24.      return0;
  25.  
  26. }

The error that keeps coming up is:
Lab03.c:13: error: expected identifier or '(' before '{' token

I've tried everything from looking at my syntax to adding "('' and semicolons everywhere, but nothing helped. Please help. Thank you very much.
Mar 26 '08 #1
4 1034
gpraghuram
1,275 Expert 1GB
Expand|Select|Wrap|Line Numbers
  1. int main() //this should be there...or else where is the function name
  2. {
  3.       (int my_age;  /* users age */); ///You cant declare like this. it should be int my_age;
  4.  
  5.  
  6.  
  7.   printf("wlcome to lab03, we will learn how to compile today \n");
  8.   printf("Enter your age: ");
  9.   scanf("%d";"&my_age");
  10.   Printf("your age is %d","\n,my_age");//This is a problem chage P to lower case printf
  11.      return0;
  12. }
  13.  
Mar 26 '08 #2
The errors are in printf and scanf check it out and for all the program main function should be there ...
Expand|Select|Wrap|Line Numbers
  1. #include<stdio.h>
  2. int main()
  3. {
  4. int my_age; /* users age */
  5. printf("wlcome to lab03, we will learn how to compile today \n");
  6. printf("Enter your age: ");
  7. scanf("%d",&my_age);
  8. Printf("your age is %d",my_age);
  9. return 0;
  10. }
  11.  
this code work perfect...
Mar 26 '08 #3
r035198x
13,262 8TB
The errors are in printf and scanf check it out and for all the program main function should be there ...
Expand|Select|Wrap|Line Numbers
  1. #include<stdio.h>
  2. int main()
  3. {
  4. int my_age; /* users age */
  5. printf("wlcome to lab03, we will learn how to compile today \n");
  6. printf("Enter your age: ");
  7. scanf("%d",&my_age);
  8. Printf("your age is %d",my_age);
  9. return 0;
  10. }
  11.  
this code work perfect...
That doesn't work. You have an uppercase P for your printf on line 8.
gp's response is rather sufficient for this.
Mar 26 '08 #4
really really appreciate it guys
Apr 1 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

65
by: Roger Smythe | last post by:
A means for the progressive decomposition a problem space into increasingly simpler component parts such that these component parts represent higher levels of conceptual abstraction, and are...
4
by: Ian Lazarus | last post by:
Greetings, Is there a consensus as to the best way to report a programming error, for example an out of bounds index value passed to a function? There are three approaches that I can think of: ...
134
by: evolnet.regular | last post by:
I've been utilising C for lots of small and a few medium-sized personal projects over the course of the past decade, and I've realised lately just how little progress it's made since then. I've...
1
by: Irritable Bowel Syndrome | last post by:
Just finished off a production .NET web application written in c#. I set up a error handler in the global.asax which is triggered to iterate through the error stack and send it and other...
6
by: Martin Ortiz | last post by:
Which is best approach? Should Try + Catch be used to only deal with "catastrophic" events (like divide by zero, non-existant file, etc...etc...) Or should Try + Catch be used IN PLACE of...
81
by: Russ | last post by:
I just stumbled onto PEP 316: Programming by Contract for Python (http://www.python.org/dev/peps/pep-0316/). This would be a great addition to Python, but I see that it was submitted way back in...
270
by: jacob navia | last post by:
In my "Happy Christmas" message, I proposed a function to read a file into a RAM buffer and return that buffer or NULL if the file doesn't exist or some other error is found. It is interesting...
29
by: Martin Schmied | last post by:
Dear folks I'm looking for good sites/material for this topic: Introduction to programming, using Javascript. So, not introduction to programming *in" Javascript. Well, I guess this would be...
5
by: mangoxoxo | last post by:
Hey I'm not sure if this is where I should be asking this but I'm going to ask anyway. I'm doing an assignment for my Intro to Comp Programming class. This is the assignment: Define a class...
2
by: Netwatcher | last post by:
Hello, i am new to c++ windows and DX programming, i encountered a code in the book stated in the title, which doesn't work for a reason, here is the code // Beginning Game Programming // Chapter...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.