Sail E0 Webinar
Question


Which of the following statements are correct about the below program?


#include<stdio.h>
int main()
{
int i = 10, j = 20;
if(i = 5) && if(j = 10)
printf("Have a nice day");
retrurn 0;
}
Options:
A .  Output: Have a nice day
B .  No output
C .  Error: Expression syntax
D .  Error: Undeclared identifier if
Answer: Option C

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

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



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers