I am having problems with Project builder.
NOTE:
I am only doing work with the C++ tool, and just began programming
When it hit Build and Run
The screen does not display my printf.
After I enter two number it displays it but not before. Why does it do that?
here is the code
#include <stdio.h>
int main (void)
{
/* Variables */
int num1, num2, sumnum;
/* Statements */
printf("Please input two whole numbers: \n");
scanf("%d %d" , &num1, & num2);
sumnum = num1 + num2;
printf("The sum is %d", sumnum);
return 0;
}
Here is the result: The two scan int had to be entered before the program would run the first printf. WHY? I want the program to printf that i must enter the numbers before I have to.
quote:
1
2
Please input two whole numbers:
The sum is 3
Test has exited with status 0.