Question
1.
2.
3.
4.
Answer (Detailed Solution Below)
Option 1 : 100
Advertisement
Detailed Solution
सही उत्तर 100 है।
Key Points
Helpful?
Question:
What does the following C nested-ternary program output? / नेस्टेड टर्नरी वाले निम्नलिखित C प्रोग्राम का आउटपुट क्या है?
#include <stdio.h> int main() { int x = 8; printf("%d", x > 5 ? (x < 10 ? 100 : 200) : 300); return 0;}
1.
100
2.
200
3.
300
4.
8
Correct Answer: 100
x > 5 is true, and the nested test x < 10 is also true, so the whole expression yields 100. / x > 5 सत्य है और भीतरी जाँच x < 10 भी सत्य है, अतः पूरा व्यंजक 100 देता है।
Downloaded from PrepSnap (prepsnap.in)