MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

DATA STRUCTURES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Give the output of the following code:#include<stdio.h>int main(){ int a = 10, b = 15, x; x = (a > b)? a:b; printf(“x = %d”, x);}
A
x = 10
B
x = 15
C
x = 0
D
x = 1
Explanation: 

Detailed explanation-1: -output is just what happens onces all the code is done, the end result. after all the calculation are done its what get put into the console. basically its what gets put out.

Detailed explanation-2: -Answer: The type( ) function returns the class type of the object passed as parameter. So, type(type(int)) will return the class ‘type’. So, the correct answer is (b).

Detailed explanation-3: -Answer: The output will be b)2. Explanation: The given code fragment starts by declaring an array in the main function.

There is 1 question to complete.