CameraIcon
CameraIcon
SearchIcon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

What is the output produced by the following program?

void main( ){int x =1, y =2, z =3;y = z++;x = x > y < z && x < y < z;printf ("%d", x + y + z);}

A
7
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
10
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
9
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
8
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
Open in App
Solution

The correct option is D 8
option (a)


x=((x>y)<z)&&((x<y)<z);=((1>3)<4)&&((1<3)<4)=(0<4)&&(1<4)=1&& 1=1x+y+z=1+3+4=8

flag
Suggest Corrections
thumbs-up
0
similar_icon
Similar questions
View More
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Formation of Algebraic Expressions
MATHEMATICS
Watch in App
Join BYJU'S Learning Program
CrossIcon