wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

C Language

Total questions: 11

Worksheet time: 6mins

Name
Class
Date
1.

What is the output of this statement "printf("%d", (a++))" ?

a)

The value of (a + 1)

b)

The current value of a

c)

Error message

d)

Garbage

2.

In the C language, the constant is defined _______.

a)

Before main

b)

After main

c)

Anywhere, but starting on a new line.

d)

None of the these.

3.

How many times will the following loop execute?

for(j = 1; j <= 10; j = j-1)

a)

Forever

b)

Never

c)

0

d)

1

4.

Which one of the following is a loop construct that will always be executed once?

a)

for

b)

while

c)

switch

d)

do while

5.

What will the result of len variable after execution of the following statements?

int len;

char str1[] = {"39 march road"};

len = strlen(str1);

a)

11

b)

12

c)

13

d)

14

6.

Which statement can print \n on the screen?

a)

printf("\\n");

b)

printf("n\");

c)

printf("n");

d)

- printf('\n');

7.

C is _______ type of programming language ?

a)

Object Oriented

b)

Procedural

c)

Bit level language

d)

Functional

8.

C language was invented to develop which Operating System?

a)

Android

b)

Linux

c)

Ubuntu

d)

Unix

9.

A pointer is a memory address. Suppose the pointer variable has p address 1000, and that p is declared to have type int*, and an int is 4 bytes long. What address is represented by expression p + 2?

a)

1002

b)

1004

c)

1008

d)

1006

10.

How many bytes does "int = D" use?

a)

0

b)

1

c)

2 or 4

d)

8

11.

What is the maximum number of characters that can be held in the string variable char address line [40]?

a)

38

b)

39

c)

40

d)

41