Home » C Programming » Control Instructions

Which of the following statements are correct about the below program? #include int main() { int i = 10, j = 20; if(i = 5) && if(j = 10) printf("Have a nice day"); return 0; }

Correct Answer: Error: Expression syntax

Explanation:

"Expression syntax" error occur in this line if(i = 5) && if(j = 10).


It should be like if((i == 5) && (j == 10)).


← Previous Question Next Question→

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion