wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Day 2 C Programming quiz

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

Operator % in C Language is called.?

a)

Percentage Operator

b)

Modulo Operator

c)

Division Operator

d)

Quotient Operator

2.

int b = 5 + 4.867;

b is ........

a)

b = 5

b)

b = 9.867

c)

b = 9

d)

compiler error.

3.

int main()

{

int a=0;

a = 4 + 5/2*10 + 5;

printf("%d", a);


return 0;

}

The output of the above code is,

a)

29

b)

None of these

c)

5

d)

34

4.

Choose a a valid type of variable name

a)

sum

b)

sum$value

c)

float

d)

piece flag

5.

Operators used in C programming language

a)

Arithmetic Operators

b)

Logical Operators

c)

Conditional Operator

d)

All the above

6.

A local variable is stored in ___

a)

Stack segment

b)

Code segment

c)

Heap segment

d)

None of the above

7.

When applied to a variable, what does the unary "&" operator yield?

a)

The variable's address

b)

the variable's right value

c)

the variable's binary form

d)

the variable's value

8.

#include<stdio.h>

int main()

{

int a=5;

a*=a;

printf("%d",a);

return 0;

}

The Output of the above code

a)

10

b)

25

c)

0

d)

5

9.

#include<stdio.h>

int main()

{

int a, b;

a = 5;

b = a++ / 2;

printf("%d", b);

return 0;

}

What will be the output of the above C program?

a)

compile-time error

b)

3

c)

2

d)

None of these

10.

#include<stdio.h>

int main()

{

int x;

x = 5;

printf("%d ", x);

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

printf("%d", x);

return 0;

}

What will be the output of the above C program?

a)

5

4

4

b)

5

4

3

c)

5

5

4

d)

5

5

5