wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

C Programming

Total questions: 10

Worksheet time: 6mins

Name
Class
Date
1.

Identify the output of the program

a)

3, 3, 3

b)

2, 2, 3

c)

4, 2, 3

d)

2, 3, 3

2.

Find the output of the program

(a)  

3.

Which of the following is more appropriate for reading in a multi-word string?

a)

scanf()

b)

printf()

c)

puts()

d)

gets()

4.

What is the output of this program?

a)

100

b)

200

c)

30

d)

500

5.

Find the output of the program

a)

Compilation error

b)

55 40 10

c)

55 55 55

d)

1 40 1

e)

0 40 1

6.

What is the name of the header file to which the function printf() and scanf() belong ?

a)

#include<stdio.h>

b)

#include<math.h>

c)

None of the above

d)

#include<string.h>

7.

Find the output of the program

a)

5, 3, 20

b)

3, 3, 20

c)

3, 2, 15

d)

5, 2, 15

8.

Find the output of the program

a)

b=100 c=200

b)

b=100 c=garbage value

c)

b=garbage value c=200

d)

b=300 c=200

9.

A single line comment line in a C Language source code can begin with

a)

;

b)

:

c)

//

d)

/*

10.

#include<stdio.h>


int main()

{

printf("%d", -11%2);

}

a)

1

b)

-1

c)

-5.5

d)

5.5