wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Day -1

Total questions: 15

Worksheet time: 11mins

Name
Class
Date
1.

Which of the following scanf statement is used to scan maximum of 4 characters from the console?

a)

scanf("%4c",str);

b)

scanf("%4s",str);

c)

scanf("%4c",&str);

d)

scanf("%4s",&str);

2.

a)

Prints nothing

b)

Hello

c)

Run time error

d)

Compilation Error

3.

____________________ is used to print a character.

a)

%str

b)

%ch

c)

%c

d)

%s

4.

a)

5

b)

24

c)

120

d)

1

5.

What will be printed while executing the following statement?

printf("12+23");

a)

12

b)

23

c)

35

d)

12+23

6.

Which of the following will be the correct code to print character 'A'?

a)
b)
c)

None of the listed options

7.
a)

True

b)

False

c)

Error

d)

Invalid Syntax

8.

Which among the following is odd one out?

a)

scanf()

b)

getchar()

c)

fscanf()

d)

printf()

9.

Find the value of the variable 'm'.

m = ++i + ++j * ++k; where, i=8, j=7, k=3.

a)

29

b)

33

c)

30

d)

41

10.
a)

lesser

b)

equal greater lesser

c)

equal

d)

none of the listed options

11.

a)

a%2<1

b)

a%2==1

c)

a%2==0

d)

a%2>1

12.

a)

TRUE

b)

compile time error

c)

Undefined Behaviour

d)

FALSE

13.
a)

None of the listed options

b)

3

c)

4

d)

5

14.

a)

1

b)

10

c)

20

d)

30

15.
a)

Hello World! x;

b)

Hello World! followed by a garbage value

c)

Compile time error

d)

Hello World!