The following statement is generating a compile-time error.
int a=6/2(1+2);
Can someone please explain why the compiler generates an error.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You’re missing a mathematical sign such as
+,-,*,/.You probably want
6/(2*(1+2))or(6/2)*(1+2).If you leave the sign out, C interprets it as a function call just like usual functions
printf("stuff")(indicated via opening parentheses without mathematical operator). So it thinks2(1+2)calls the function2with argument1+2.