wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Quiz on C Fundamentals for CSE & CST

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

Guess the output?

a)

3

b)

-4

c)

4

d)

Compile error

2.

What is the output of following program?

a)

0

b)

1

c)

2

d)

3

3.

Which of the following operator can be used to access value at address stored in a pointer variable?

a)

*

b)

&

c)

->

d)

.

4.

To print a double value, which format specifier can be used?

a)

%l

b)

%ld

c)

%d

d)

%lf

5.

What is the output of the following code snippet?

a)

Hi

b)

HelloHi

c)

Compile error

d)

Compiler warning

6.

What is the output of the below code snippet?

a)

Infinite loop

b)

Prints “Hello” once

c)

No output

d)

Compile error

7.

What is the output of the below code snippet?

a)

Infinite loop

b)

Prints “Hello” once

c)

No output

d)

Compile error

8.

int x=~1; What is the value of 'x'?

a)

1

b)

-1

c)

2

d)

-2

9.

What is the output of the following code snippet?

a)

15

b)

Garbage value

c)

Run-time error

d)

Compile-time error

10.

What is the output of the following program?

a)

Hello

b)

hi

c)

Hellohi

d)

Compile error

11.

What will be printed for the below statement?

a)

0

b)

1

c)

-1

d)

Invalid use of strcmp() function

12.

What is the output of the following program?

a)

0

b)

1

c)

2

d)

Compile error

13.

What is the size of ‘int’ data type?

a)

2

b)

4

c)

8

d)

Compiler dependent

14.

What is the output of the following program?

a)

Hi

b)

Hello

c)

HiHello

d)

Compile error

15.

What is the output of the following program?

a)

1

b)

2

c)

Compile error

d)

Run-time error

16.

What is the output of the following program?

a)

1

b)

2

c)

3

d)

Compile error

17.

Predict the output of the following code.

a)

1

b)

2

c)

3

d)

Compile error

18.

The reason for using pointers in a C program.

a)

Pointers allow different functions to work on the same data

b)

When we pass structures as argument, the complete copy of the structure can be avoided.

c)

Pointers enable implementation of non-linear data structures

d)

All of the above

19.

Assume int is 2 bytes, char is 1 byte and float is 4 bytes. Also, assume that the pointer size is 4 bytes. Predict the output.

a)

1 2 4

b)

1 4 4

c)

4 4 4

d)

None of the above

20.

What will be the output produced by the following C code?

a)

0

b)

1

c)

-1

d)

Compile error