wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Operators in C

Total questions: 10

Worksheet time: 2mins

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.

Which of the following is not a Bitwise operator?


a)

&&

b)

&

c)

|

d)

~

3.

#include <stdio.h>

void main()

{

int x = 5 * 9 / 3 + 9;

}

a)

none

b)

23

c)

2.8

d)

24

4.

Among the given operators which operator has the lowest precedence

a)

++

b)

+

c)

%

d)

||

5.

What is the output of the following code

int main()

{

int y=2;

int z=5;

y/=z+2;

printf("y= %d\n",y);

}

a)

0

b)

2

c)

1

d)

7

6.

What will be the output of the following program

#include<"stdio.h>

int main()

{

int x, y = 5, z = 5;

x = y == z;

printf(\"%d\", x);

getchar();

return 0;

}

a)

1

b)

0

c)

5

d)

none

7.

Find the output of the given C program.

#include<stdio.h>

int main()

{

printf("%d ", -9 && 9);

printf("%d", -9 || 9);

return 0;

}

a)

9999

b)

99

c)

00

d)

11

8.

What will be the output of following program ?

#include <stdio.h>

void main()

{

printf("value is = %d",(10++));

}

a)

11

b)

10

c)

0

d)

ERROR

9.

//What will be the output of the given program in turbo C

#include <stdio.h>

void main()

{

int x=10;

x+=(x++)+(++x)+x;

//printf("%d\n",y);

printf("%d",x);

}

a)

44

b)

45

c)

46

d)

11

10.

What is the output of the following program

#include <stdio.h>

void main()

{

int a=10,b=2,x=0;

x=a+b*a+10/2*a;

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

}

a)

120

b)

90

c)

89

d)

80