Hi, everyone.
I am a C programming learner. I wrote a little program but I get an error message when I try to compile it with gcc compiler.
This is my little program:
Code:
#include <stdio.h>
int main()
{
int answer;
printf ("Welcome to the English language quiz!\nPlease answer the next question:\nWhat is the colour of the Lemon?\n1)Red\n2)Orange\n3)Yellow\nPlease type in the number of the right answer and press Enter:");
scanf ("%d, &answer");
if (answer == 3)
{
printf ("Congratulations! Your answer is right.");
}
else
{
printf ("Sorry. The right answer is 3)Yellow.");
}
return 0;
}
Error message:
Code:
liviu@liviu-pc ~/Desktop $ gcc welcome\ to\ c\ programming.c
welcome to c programming.c: In function ‘main’:
welcome to c programming.c:8:1: warning: too few arguments for format
Can somebody explain to me what is wrong?
Thank you.