Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Code Twisters Round 1 Demo

Total questions: 10

Worksheet time: 2mins

Name
Class
Date
1.

1. What is the format specifier for printing an integer in C?

a)

%d

b)

%c

c)

%f

d)

%s

2.

2. Which operator is used to get the address of a variable?

a)

*

b)

&

c)

-

d)

@

3.

3. Which of the following is a correct syntax to declare a pointer?

a)

*int p;

b)

int p*;

c)

int *p;

d)

int p;

4.

4. Which function is used to read a string from standard input?

a)

scanf()

b)

fgets()

c)

getch()

d)

gets()

5.

5. Which loop guarantees at least one execution of the loop body?

a)

for loop

b)

do-while loop

c)

while loop

d)

None of the Above

6.

6. What will be the output of printf("%d", 5/2);?

a)

2

b)

2.5

c)

3

d)

0

7.

7. What is the return type of the malloc() function?

a)

int

b)

char*

c)

void*

d)

float*

8.

8. Which of the following are keywords in C?

a)

int, char, printf

b)

for , if , float

c)

scanf , while ,void

d)

double, extern , register

9.

9. Which of the following functions are used to allocate memory dynamically?

a)

malloc() , free()

b)

scanf(),printf()

c)

calloc(),malloc()

d)

realloc() , free()

10.

What will sizeof(char) return?

a)

2

b)

4

c)

1

d)

8