C Programming - Control Instructions - Discussion
Discussion Forum : Control Instructions - Point Out Correct Statements (Q.No. 1)
1.
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");
return 0;
}
Answer: Option
Explanation:
"Expression syntax" error occur in this line if(i = 5) && if(j = 10).
It should be like if((i == 5) && (j == 10)).
Discussion:
12 comments Page 2 of 2.
Nancy said:
1 decade ago
Can two if expressions be combined in the format given above?
Karthi said:
1 decade ago
if i give condition
if((i==5)&&(j==10))
means wt will be the answer for this...
if((i==5)&&(j==10))
means wt will be the answer for this...
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers