 Expressions  General Questions
 Expressions  Find Output of Program
 Expressions  True / False Questions
 Expressions  Yes / No Questions
Expressions
 
 

1.  Relational 
2.  Arithmetic 
3.  Logical 
4.  Assignment 
A 2134
B 1234
C 4321
D 3214
ANS:A  2134
2. Arithmetic operators: *, /, %, +, 
1. Relational operators: >, <, >=, <=, ==, !=
3. Logical operators : !, &&, 
4. Assignment operators: =
1. Relational operators: >, <, >=, <=, ==, !=
3. Logical operators : !, &&, 
4. Assignment operators: =
Q4: Which of the following is the correct usage of conditional operators used in C?
A a>b ? c=30 : c=40;
B a>b ? c=30;
C max = a>b ? a>c?a:c:b>c?b:c
D return (a>b)?(a:b)
ANS:C  max = a>b ? a>c?a:c:b>c?b:c
Option A: assignment statements are always return in paranthesis in the case of conditional operator. It should be a>b? (c=30):(c=40); Option B: it is syntatically wrong. Option D: syntatically wrong, it should be return(a>b ? a:b); Option C: it uses nested conditional operator, this is logic for finding greatest number out of three numbers.
Q5: Which of the following is the correct order of evaluation for the below expression?
z = x + y * z / 4 % 2  1
A
* / % +  =
B = * / % + 
C / * %  + =
D / * %  + =
ANS:A 
* / % +  =
C uses left associativity for evaluating expressions to break a tie between two operators having same precedence.
Q6: Which of the following are unary operators in C?
1.  ! 
2.  sizeof 
3.  ~ 
4.  && 
A 1, 2
B 1,3
C 2,4
D 1,2,4
ANS:D  1,2,4
An operation with only one operand is called unary operation.
Unary operators:
! Logical NOT operator.
~ bitwise NOT operator.
sizeof Sizeof operator.
&& Logical AND is a logical operator.
Therefore, 1, 2, 3 are unary operators.
For help Students Orientation
Mcqs Questions
One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.