Curioustab
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Home
»
C Programming
»
Declarations and Initializations
What is the output of the program #include<stdio.h> int main() { int x = 10, y = 20, z = 5, i; i = x < y < z; printf("%d\n", i); return 0; }
0
1
Error
None of these
Show Answer
Correct Answer:
1
Explanation:
Since
x < y
turns to be TRUE it is replaced by 1. Then
1 < z
is compared and to be
TRUE
. The 1 is assigned to
i
.
← Previous
Next →
Discussion & Comments
No comments yet. Be the first to comment!
Name:
Comment:
Post Comment