Question 1
Guess the Output of the following program.
int i=1 ;
(i == 1 ? printf( "Case 1" ): printf("Case 2"));
A
Case 2
B
Compile Error
C
Case 1
D
Run Time Error
Question 2
What will be the output of the following code ?
int i=1 ;
(i == 1 ? printf("Case %d",i): printf("Case 2"));
A
Run Time Error
B
Compile Error
C
Case 2
D
Case 1
Question 3
int num, a=10, b=20, c=30 ;
num = (a > b ? ( a > c ? 10: 30 ) : ( b > c ? 20: 30 ) );
printf("%d");
Guess the output of the code.
A
Compile Error
B
30
C
20
D
10
Question 4
Can we use nested statements inside Conditional Statement ?
A
Yes
B
No
Question 5
Suppose a = 20, b = 10 then guess the output of the following code.
a > b ? temp = a : temp = b;
A
Value of a is assigned to b
B
Compile Error
C
Value of a is assigned to temp
D
Value of b is assigned to temp
Question 5 Explanation: 
a > b ? temp = a : temp = b;
In absence of parentheses the compiler believes that b is being assigned to the result of the expression to the left of second "=". i,e Suppose a>b is true then Compile will interpret it as -
temp = a = b
Instead of it write statement like this -
a > b ? temp = a : (temp = b);
Question 6
for (i = 0; i < n; i++)
  printf("%6d%c", a[i], (i%10==9 || i==n-1) ? '\n' : ' ');
We are printing the array of size 10. Then each element in this example will be separated by -
A
New Line
B
Backslash
C
Space
D
Tab
Question 7
#include <stdio.h>
int main(int argc, char *argv[])
{
 int i=0;
 int n=15;
 int a[15] = {0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5};
 for (i = 0; i < n; i++)
   printf("%6d%c", a[i], (i%10==9 || i==n-1) ? '\n' : ' ');
    return 0;
}
What will be the last number printed on the first line.
A
9
B
0
C
1
D
8
Question 8
Following Code Snippet Can be written as -
if ( expression1 ) { 
  expression3
} else { 
  expression2 
}
A
statement 2 ? statement 1 : statement 3
B
statement 1 ? statement 2 : statement 3
C
statement 2 ? statement 3 : statement 1
D
statement 1 ? statement 3 : statement 2
Question 9
What error we will get after compiling following program -
a > b ? temp = a : temp = b ;
A
Undefined Symbol ?
B
R Value Require
C
Statement Missing }
D
L Value Require
Question 10
Following program will print _________ number.
int num, a=10, b=20, c=30 ;
num = (a > b ? ( a > c ? 10: 30 ) : ( b > c ? 20: 30 ) );
A
Smallest Number
B
Largest Number
C
Random Number
D
Even Number
There are 10 questions to complete.