| | |
Compliler errors
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Oct 2006
Posts: 6
Reputation:
Solved Threads: 0
[6 #include <stdio.h>
7 int main ()
8 /* Declare and initialize variables. */
9 int number1 = 4, number2 = 7, sum;
10 /* Calculate sum. */
11 sum = numberl + number2;
12 /* Print the sum. */
13 printf("The sum is */.d \n", sum);
14 /* Exit program. */
15 system ("pause");
16 return 0;]
We HAVE to work within Bloodshed 4.9.9.2.
Please help me.
Errors per compiler:
In function 'main'
line 9 parameter 'number1' is initilaized
line 9 parameter 'number2' is initialized
line 11 syntax error b4 sum
7 int main ()
8 /* Declare and initialize variables. */
9 int number1 = 4, number2 = 7, sum;
10 /* Calculate sum. */
11 sum = numberl + number2;
12 /* Print the sum. */
13 printf("The sum is */.d \n", sum);
14 /* Exit program. */
15 system ("pause");
16 return 0;]
We HAVE to work within Bloodshed 4.9.9.2.
Please help me.
Errors per compiler:
In function 'main'
line 9 parameter 'number1' is initilaized
line 9 parameter 'number2' is initialized
line 11 syntax error b4 sum
Well loads of problems. Lets discuss each pf the:
1. Learn to indent your code and do not insert linenumbers before each line. We dont need that, [ code ] tags does it for you. See this.
2. Now the problems with code. First one is that you havn't inserted '{' at beginning and '}' at end of main() function.
3. In
4. You have use printf() function improperly. It must be
5. Dont use system("pause"). Although it has nothing to do with errors but try using
1. Learn to indent your code and do not insert linenumbers before each line. We dont need that, [ code ] tags does it for you. See this.
2. Now the problems with code. First one is that you havn't inserted '{' at beginning and '}' at end of main() function.
3. In
sum = numberl + number2;line you have typed numberl instead of number1.4. You have use printf() function improperly. It must be
printf("The sum is %d \n", sum);. Read This.5. Dont use system("pause"). Although it has nothing to do with errors but try using
getchar() instead. Read This. Last edited by vishesh; Sep 5th, 2007 at 3:41 am.
![]() |
Similar Threads
- Simple Programming Errors (Computer Science)
- confused with errors in c++ (C++)
- Windows XP and Corel Suite 8 (WP8) errors (Windows NT / 2000 / XP)
- Loader.EXE and IEDLL.EXE errors (Web Browsers)
- Errors during scandisk (Windows 95 / 98 / Me)
- Upgrading Xp Home to Pro - ERRORS! (Windows NT / 2000 / XP)
- strange annoying errors (Windows NT / 2000 / XP)
- w2k server errors (Windows NT / 2000 / XP)
- Two Problems- "Page Cannot Be Displayed" Errors, Z (Windows NT / 2000 / XP)
Other Threads in the C++ Forum
- Previous Thread: Newbie question(open a file)
- Next Thread: Function to convert a binary to decimal
| Thread Tools | Search this Thread |
api array arrays beginner binary bitmap c++ c/c++ calculator char class classes code compile compiler console conversion convert count data database delete desktop developer directshow dll download dynamic encryption error file forms fstream function functions game generator getline givemetehcodez google graph gui homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux loop looping loops map math matrix memory multiple news node number output parameter pointer problem program programming project proxy python random read recursion recursive return string strings struct temperature template templates test text text-file tree unix url variable vector video visualstudio win32 windows winsock word wordfrequency wxwidgets






