I have a simple c program outputing a message asking for user input. Then a scanf function reading in user input. When the program is run, the program execute the scanf function first before printf is executed asking for user input. What is wrong with the program?
int main ()
{
int i;
printf ("Enter integer: ");
scanf ("%d", &i);
return 0;
}