I'm a novice C programmer using the Ubuntu terminal to compile. As in, I just started today. The compiler keeps coming up with this:
Variable1.c: In function 'main':
Variable1.c:9:46: error: expected ')' before string constant
I checked all over for mismatched parentheses. Here is the code.
Code:
#include <stdio.h>
int main()
{
int this_is_a_number;
printf ( "Please enter a number: " );
scanf ( "%d", &this_is_a_number );
printf ( "You entered %d", this_is_a_number"\n" );
getchar();
if ( this_is_a_number==1 ){
printf ( "Correct! \n");
}
else {
printf ( "Incorrect. Press enter to be exited from the program. \n");
}
getchar();
return 0;
}
Any ideas on what is wrong? I am a beginner, so it's probably something fundamental that I missed.