Table of Content

Variable [MCQ] : Find Output of Program (Multiple Choice Questions)


Question 1
In the following expression guess the correct order of execution of operator ?
z = x - y / z * 1 % 2 + 1
A
/ * % - + =
B
* / % - + =
C
= / * - % +
D
= / * % - +
Question 2
Which of the following are unary operators in C ?
  1. !
  2. sizeof
  3. ~
  4. &&
A
1 2
B
3 4
C
1 2 3
D
1 3
Question 3
Arrange the following operators in decreasing order of Operator Precedence.
  1. Arithmetic Operator
  2. Unary Operator
  3. Comparison Operator
  4. Shift Operator
A
2 1 3 4
B
1 2 3 4
C
2 1 4 3
D
1 2 4 3
Question 4
Arithmetic Operator has associtivity from ___________ to ____________.
A
Right to Left
B
Left to Right
Question 5
Which of the following is correct use of Conditional Operator ?
A
a>b ? c=10;
B
max = a>b ? a>c?a:c:b>c?b:c
C
a>b ? c=50 : c=140;
D
a>b : c=10;
There are 5 questions to complete.