WorksheetsCLab 12
Total questions: 10
Worksheet time: 5mins
In the given code, what message is appropriate to display?
int status = (num & 1);
if(status==1)
printf(what msg will you print here?? );
num is even
num is odd
num is prime
num is negative
Left shift of a number N is always multiple of 2.
True
False
What will be the output of the following code:
int a = 2;
printf("%d", a>>3);
4
-1
8
16
When applied to a variable, what does the unary "&" operator yield?
The variable's address
The variable's right value
The variable's binary form
The variable's value
When applied to a variable, what does the unary "&" operator yield?
The variable's address
The variable's right value
The variable's binary form
The variable's value
The operator "&" is used for
Bitwise AND
Bitwise OR
Logical AND
Logical OR
An expression contains relational, assignment and arithmetic operators. If parenthesis are not specified, the order of evaluation of the operators would be:
assignment, arithmetic, relational
relational, assignment, arithmetic
assignment, relational, arithmetic
arithmetic, relational, assignment
enum status = { flag=1, flag=3};
printf("%d", sizeof(status));
1
2
3
4
int a=4;
printf("%d", a>>2);
0
1
2
8
int b=8;
printf("%d", a<<2);
4
2
16
32
