wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Practice Test Operator and Control Flow Statement 01

Total questions: 15

Worksheet time: 15mins

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.

#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

11.

#include <stdio.h>


void main()

{


int x = 5 * 9 / 3 + 9;


}

a)

24

b)

3

c)

23

d)

4

12.

Loops Means Repeat Statement One Time Only ?

a)

True

b)

False

13.

A ________________ executes the sequence of statements many times until the stated condition becomes false.

a)

data structures

b)

control structures

c)

loop

d)

OOPS

14.

A ______________ is a control flow statement that executes a block of code at least once.

a)

do loop

b)

do while loop

c)

while loop

d)

for loop

15.

The meaning of the operator ______ is modulus in C language.

a)

a. ++

b)

b. mod

c)

c. %

d)

d. *