C Language MCQ’S | Control Instructions 13

61.
The output of the code below is

void main()
{
int k = 8;
int m = 7;
k < m ? k++ : m = k;
printf(“%d”, k);
}

A. 7
B. 8
C. Compile time error
D. Run time error

 

62.
The output of the code below is

void main()
{
int k = 8;
int m = 7;
k < m ? k = k + 1 : m = m + 1;
printf(“%d”, k);
}

A. Compile time error
B. 9
C. 8
D. Run time error

 

63.
For initialization a = 2, c = 1 the value of a and c after this code will be c = (c) ? a = 0 : 2;

A. a = 0, c = 0;
B. a = 2, c = 2;
C. a = 2, c = 2;
D. a = 1, c = 2;

 

64.
What will be the data type of the expression (a < 50) ? var1 : var2; provided a = int, var1 = double, var2 = float

A. float
B. int
C. double
D. Cannot be determined

 

65.
Which expression has to be present in the following? exp1 ? exp2 : exp3;

A. exp1
B. exp2
C. exp3
D. All of the mentioned