Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Operators in C

Total questions: 12

Worksheet time: 5mins

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.

Which operator has the lowest priority?

a)

++

b)

%

c)

+

d)

||

5.

int main()

{

int a = 25%10;

printf("%d", a);


return 0;

}

a)

5

b)

2

c)

2.5

d)

5.5

6.

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

a)

True

b)

False

7.

!= is the example of ____________________ operator.

a)

Relational

b)

Logical

c)

Assignment

d)

Conditional

8.

++ and -- are unary operators.

a)

True

b)

False

9.

Which of the following is not a Bitwise operator?

a)

&

b)

|

c)

<<

d)

&&

10.

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

a)

= =

b)

<

c)

>

d)

=

11.

#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

12.

#include <stdio.h>


void main()

{


int x = 5 * 9 / 3 + 9;


}

a)

24

b)

3

c)

23

d)

4