THESE 275 QUESTIONS ARE ENOUGH TO CRACK INTERVIEW OR WRITTEN EXAM ON C...(CONCEPTS ARE GIVEN IN DETAIL FOR EACH QUESTION)
Q.1 What is the output of the following program?
main ( )
{
int x = 2, y = 5;
if (x < y) return (x = x+y); else printf (“z1”);
printf(“z2”);
}
(A) z2 (B) z1z2
(C) Compilation error (D) None of these
Ans: D
There is no compilation error but there will no output because function is returning a
value and if statement is true in this case.
Q.1 What is the output of the following program?
main ( )
{
int x = 2, y = 5;
if (x < y) return (x = x+y); else printf (“z1”);
printf(“z2”);
}
(A) z2 (B) z1z2
(C) Compilation error (D) None of these
Ans: D
There is no compilation error but there will no output because function is returning a
value and if statement is true in this case.
No comments:
Post a Comment