Font size
WorksheetsC Operators
Total questions: 15
Worksheet time: 6mins
In C, the result of the conditional operator is ____________.
true
false
1
0
Select the data types that can be used with the % operator.
int
float
double
all of the above
What is the output of the given code?
Error
10 20 30
10 20 1
10 200 1
What is the output of the given code?
Error
10 20 30
10 20 1
10 200 1
What is the output of the given code?
Error
10 20 30
100 100 100
100 200 300
None of the above
Which bitwise operator is suitable for unsetting a bit in a number?
|
&
^
~
All the above
Which bitwise operator is suitable for setting a bit in a number?
|
&
^
~
All the above
The output of an arithmetic expression with integer and float is __________.
int
float
can't be defined
operation not possible
What is the value of 'a' in the following statement?
int a = 10 + 10.55;
Error
20.55
20
Can't be defined
What is the value of 'a' in the following statement?
int a = 10.55 + 10.55;
20
21
21.10
error
Select the suitable statement to toggle the kth bit of the number 'n'.
n = n | ( 1 << k )
n = n & ( 1 << k )
n = n ^ ( 1 << k )
n = n & ~( 1 << k )
Select the suitable statement to convert a character 'ch' to UPPERCASE.
ch = ch ^ 32
ch = ch | 32
ch = ch & ~32
ch = ch & 32
What is the output of the given code?
10 10
10 100
100 100
10 20
None of the above
Write a statement to check if a positive integer is a power of 2 without using any branching or loop.
What do you feel about CRT sessions?
Poor
Average
Good
Excellent
