WorksheetsOperators in C
Total questions: 24
Worksheet time: 11mins
int x;
int y;
int z;
x=3;
y=4;
z = ++x * y++;
printf("%d",z);
12
16
20
0
In C programming language, which of the following type of operators have the highest precedence
Relational operators
Equality operators
Logical operators
Arithmetic operators
Which of the following comments about the ++ operator are correct?
1) It is a unary operator
2) The operand can come before or after the operator
3)It associates from the right
1 and 3
1 and 2
2 and 3
1,2,3
int main()
{
int a = 25%10;
printf("%d", a);
return 0;
}
5
2
2.5
5.5
++ and -- are unary operators.
True
False
Which of the following is not a Bitwise operator?
&
|
<<
&&
The _____________ operator checks if the value of left operand is greater than the value of right operand.
= =
<
>
=
#include <stdio.h>
int main()
{
int i = 95;
char c = 97;
printf("%d, %d\n", sizeof(i), sizeof(c));
return 0;
}
4,1
4,2
2,4
2,8
#include <stdio.h>
void main()
{
int x = 5 * 9 / 3 + 9;
printf ("%d",x);
}
24
3
23
4
#include <stdio.h>
int main() {
int y = 2;
int z = y +(y = 10);
printf("%d\n", z);
}
12
20
Either 12 or 20
4
void main()
{
int a, b = 2, c;
a = 2 * (b++);
c = 2 * (++b);
}
a = 4, c = 8
a = 3, c = 8
b = 3, c = 6
a = 4, c = 6
16>>2
4
8
32
64
What is the other name for C Language ?: Question Mark Colon Operator.?
Comparison Operator
If-Else Operator
Binary Operator
Ternary Operator
Which of the following is not a compound assignment operator?
+=
/=
%=
==
What is the output of the following printf
printf("%d",34+24/12%3*5/2-4);
35
-2
34
38
What is the output of the following code:
#include<stdio.h>
void main()
{
int a=10,b=80,c=45;
printf("%d",a<b>c);
}
0
1
10
Error
What is the output of the following code:
#include<stdio.h>
void main()
{
int a=10,b=-5;
printf("%d",a&&b);
}
1
0
Error
10
-5
What is the output of the following printf
int a=9;
printf("%d",~a);
10
-10
6
-9
What is the output of the following printf
int a=-11;
printf("%d",!a);
0
1
12
10
What is the output of the following printf:
int a=6,b=8;
printf("%d",a^b);
14
0
6
8
What is the output of the following printf:
int a=10,b=3;
printf("%d",a<<b);
80
0
20
40
What is the output of the following code snippet:
int a=12;
a?printf("GEC"):printf("IT");
GEC
IT
GECIT
Error
What is the output of the following printf:
int a=10,b=8;
printf("%d",a+~b);
1
18
19
2
Which operators perform operations on data in binary level?
Logical operator
Bitwise operator
Additional opertors
None of the above
