[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

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

9 Years
Discussion Span
Last Post by Salem

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 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.

Right Advice :)
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.