Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Coding Quiz in C

Total questions: 30

Worksheet time: 21mins

Name
Class
Date
1.

What is the Output ?

a)

21

b)

5

c)

13

d)

111

2.

What is the Output ?

a)

3.000

b)

3

c)

3.5

d)

3.500

3.

In C '&' used in 'scanf' represents

a)

For separating input data

b)

Pointer to variable

c)

Memory Location

d)

And operator

4.

What is the Output ?

a)

6 6 2

b)

12 0 3

c)

Runtime Error

d)

Compilation Error

5.

'Continue' statement is used to ?

a)

To stop program execution

b)

To go next line

c)

To Stop Current iteration and start next iteration

d)

To run infinite loop

6.

An Array is initialized with size 20 in c. if first element location is at 1940(memory address), what will the location of 11th element?

(size of int = 2bytes)

a)

1961

b)

1960

c)

1950

d)

1951

7.

what does following code do??

a)

Makes the Given Matrix Symmetric

b)

Transpose the Matrix

c)

Matrix Multiplication

d)

None of this

8.

What is the Output?

a)

prints "Hello World"

b)

prints "Hello World" 5 times in same line

c)

prints "Hello World" 5 times in multiple line

d)

prints "0"

9.

What is the Value of "256>>1"

a)

25

b)

128

c)

257

d)

256

10.

first and second term in geometric progression are 3 and 6 find common ratio?

a)

9

b)

2

c)

3

d)

18

11.

What is (void*)0?

a)

Representation of void pointer

b)

Representation of NULL pointer

c)

Error

d)

Representation of int pointer

12.

What will be the output of the following C code?

a)

2 3

b)

2 garbagevalue

c)

Error

d)

2 4

13.

What is the Average and Worst time complexities of Binary Search Algorithm

a)

O(1) , O(1)

b)

O(log n) , O(log n)

c)

O(1) , O(log n)

d)

O(log n) , O(n)

14.

Average time Complexity of Merge Sort?

a)

O(n log n)

b)

O(n^2)

c)

O(n)

d)

O(log n)

15.

What is Output ?

a)

P

b)

o

c)

Coding Club

d)

oding Club

16.

Which type of pointer is a most convention way of storing raw address in c programming?

a)

Void Pointer

b)

Double Pointer

c)

Null Pointer

d)

Integer Pointer

17.

Among 4 header files, which should be included to use the memory allocation functions like malloc(), calloc(), realloc() and free()?

a)

<string.h>

b)

<memory.h>

c)

<stdlib.h>

d)

Both

<memory.h>

<stdlib.h>

18.

What is the return type of malloc() or calloc()?

a)

int *

b)

int **

c)

void *

d)

void **

19.

What is output?

a)

100

b)

Compilation Error

c)

0

d)

Garbage Valur

20.

What is Output ?

a)

-1

b)

0

c)

1

d)

Compilation Error

21.

In C File is a type of?

a)

int

b)

char *

c)

struct

d)

void

22.

If an error occurs, the function fseek() will returns

a)

-1

b)

NULL

c)

non-zero value

d)

0

23.

What is Output ?

a)

14

b)

13

c)

12

d)

11

24.

What is the output ?

a)

Error

b)

i = 1

c)

i = 16

d)

i = 0

25.

What is output ?

a)

1

b)

6

c)

3

d)

Error

26.

what is Output ?

a)

3 3 1 3 1

b)

3 3 1 3 0

c)

Garbage Values

d)

Error

27.

What is the Output ?

a)

Compilation Error

b)

Runtime Error

c)

False

d)

True

28.

How many times is Hello world printed ?

a)

1

b)

4

c)

2

d)

8

29.

What is output?

a)

print i till 9 and j till 19

b)

print i and j till 19

c)

print i and j till 9

d)

Error

30.

The operators (. , !! , < , = )

Ascending order of precedence is?

a)

. !! < =

b)

< !! = .

c)

= < !! .

d)

= !! < .