wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

C classroom activity 8.4.25

Total questions: 20

Worksheet time: 9mins

Name
Class
Date
1.

int x;

int y;

int z;

x=3;

y=4;

z = ++x * y++;

printf("%d",z);

a)

12

b)

16

c)

20

d)

0

2.

In C programming language, which of the following type of operators have the highest precedence

a)

Relational operators

b)

Equality operators

c)

Logical operators

d)

Arithmetic operators

3.

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

a)

1 and 3

b)

1 and 2

c)

2 and 3

d)

1,2,3

4.

int main()

{

int a = 25%10;

printf("%d", a);


return 0;

}

a)

5

b)

2

c)

2.5

d)

5.5

5.

The modulus operator (%) can be used only with integers.

a)

True

b)

False

6.

!= is the example of ____________________ operator.

a)

Relational

b)

Logical

c)

Assignment

d)

Conditional

7.

Which of the following is not a Bitwise operator?

a)

&

b)

|

c)

<<

d)

&&

8.

The _____________ operator checks if the value of left operand is greater than the value of right operand.

a)

= =

b)

<

c)

>

d)

=

9.

#include <stdio.h>


int main()

{


int i = 95;


char c = 97;


printf("%d, %d\n", sizeof(i), sizeof(c));


return 0;

}

a)

2,1

b)

4,2

c)

2,4

d)

2,8

10.

#include <stdio.h>


void main()

{


int x = 5 * 9 / 3 + 9;


}

a)

24

b)

3

c)

23

d)

4

11.

1011 & 0111

a)

1000

b)

0011

c)

1011

d)

None of these

12.

#include <stdio.h>

int main() {

int y = 2;

int z = y +(y = 10);

printf("%d\n", z);

}

a)

12

b)

20

c)

Either 12 or 20

d)

4

13.

4<<2

a)

16

b)

8

14.

16>>2

a)

4

b)

8

c)

32

d)

64

15.

int x = 15;

(x>0)?printf("x is greater"):printf("x having negative values")

Find the Output.

a)

Error

b)

x is greater

c)

x having negative values

d)

None of these

16.

int x = 15;

x=+5;

printf("x value is: %d",x);

a)

Error

b)

x value is: 20

c)

x value is: 15

d)

None of these

17.

int x = 15, y=10;

if(x>20 && y<=10)

printf("Condition Satisfied");

else

printf("Condition not satisfied");

a)

Error

b)

Condition Satisfied

c)

Condition not Satisfied

d)

None of these

18.

What is the other name for C Language ?: Question Mark Colon Operator.?

a)

Comparison Operator

b)

If-Else Operator

c)

Binary Operator

d)

Ternary Operator

19.

Which of the following is not a compound assignment operator?

a)

+=

b)

/=

c)

%=

d)

==

20.

#include <stdio.h>


void main()

{


int x = 5 * 9 / 3 + 9;

printf ("%d",x);


}

a)

24

b)

3

c)

23

d)

4