Choose correct option(1-marks) s based What is the output of this program #include int main int k, num = 100; k = (num 50 (num = 10 100 200): 500); 2 : printfºod n num; return 0 a. 500 b. 100 C. 200 d. 300 OPTION
Answers
Answered by
0
Explanation:
Answer: Option B
Explanation:
Step 1: int k, num=30; here variable k and num are declared as an integer type and variable num is initialized to '30'.
Step 2: k = (num>5 ? (num <=10 ? 100 : 200): 500); This statement does not affect the output of the program. Because we are going to print the variable num in the next statement. So, we skip this statement.
Step 3: printf("%d\n", num); It prints the value of variable num '30'
Step 3: Hence the output of the program is '30'
Similar questions
English,
11 hours ago
Chemistry,
11 hours ago
Math,
11 hours ago
English,
21 hours ago
Business Studies,
8 months ago