Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Test-3

Total questions: 15

Worksheet time: 13mins

Name
Class
Date
1.

What will be the output of the following code snippet?

a)

10 30

b)

30 10

c)

10 20

d)

20 10

2.

What will be the value of x in the following code snippet?

a)

10

b)

5

c)

1

d)

0

3.

What will be the output of the following code snippet?

a)

023 23

b)

23 23

c)

19 23

d)

23 19

4.

What will be the result of the following code snippet?

a)

45

b)

36

c)

20

d)

100

5.

What is the default return type if it is not specified in function definition?

a)

float

b)


void

c)

int

d)

double

6.


In C, function parameters are always

a)

Passed by value

b)

Passed by reference

c)

Passed by value result

d)

None of these

7.


What is the output?

a)

10

b)

9

c)

11

d)

None

8.

Which is the complete function?

a)

int fun();

b)


int func(int x)
{
return x=x+1;
}

c)

void fun(int)
{
printf("Hello");
}

d)

void fun(x)
{
printf("Hello");
}

9.

What is the output?

a)

WORLD HELLO

b)

HELLO WORLD

c)

"HELLO WORLD"

d)

Compile error

10.

What is the output?

a)


COUNT=15

b)

COUNT=35

c)


COUNT=0

d)

Error

11.

What will be the output of the following C code?

a)

24

b)

4

c)

12

d)

10

12.

The data structure used to implement recursive function calls _____________

a)

Array

b)

Linked list

c)

Binary tree

d)

Stack

13.

In the absence of a exit condition in a recursive function, the following error is given __________

a)

Compile time error

b)

Run time error

c)

Logical error

d)

No error

14.

What will be the output of the following C code?

a)

++++2

b)

+++++2

c)

+++++

d)

2

15.

How many times is ‘a’ printed when the following C code is executed?

a)

9 times

b)

10 times

c)

0 times

d)

Infinite number of times