wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

SPARK FIDDLE

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

Choose a right “c “statement

a)

Loop or repetition block executes group of statements repeatedly.

b)

Loop is usually executed as long as a condition is met.

c)

Loops usually take advantage of loop counter.

d)

All the above.

2.

Loop in “C” language is implemented using.

a)

While Block

b)

Do while Block

c)

For Block

d)

All the above

3.

A pointer is

a)

A keyword used to create variables.

b)

A variable that stores address of an instruction.

c)

A variable that stores address of other variables.

d)

All of the above.

4.

The printf() function retunes which value when an error occurs?

a)

Positive value

b)

Negative value

c)

Zero

d)

None of These

5.

Which of these about a dictionary is false?

a)

The keys of a dictionary can be accessed using values

b)

The values of a dictionary can be accessed using keys

c)

Dictionaries aren’t ordered

d)

Dictionaries are mutable

6.

In python, Dictionaries are immutable.

a)

False

b)

True

7.

Which of these are the escape sequence in python string formatting

a)

Newline

b)

Backslash

c)

Single quotes

d)

All of the above

8.

Find the right pair from the following

a)

w=open a file for reading

b)

r=open a file for writing

c)

+=open a file for updating

d)

b=opens in text body

9.

Python function always returns a value

a)

False

b)

True

10.

What is the output of the following function call

def fun1(name, age=20):

print(name, age)

fun1('Emma', 25)

a)

Emma 25

b)

Emma 20

11.

.”C” is a low level language

a)

True

b)

False

12.

First _____ characters of identifier are significant

a)

45

b)

67

c)

63

d)

53

13.

In python programming pass is a null statement

a)

True

b)

False

14.

How many times it will print the statement?

for i in range(100):

print(i)

a)

101

b)

99

c)

100

d)

0

15.

The keyword used to transfer control from a function back to the calling function is

a)

switch

b)

goto

c)

go back

d)

return

16.

The function scanf( ) returns

a)

The actual values read for each argument

b)

1

c)

0

d)

The number of successful read input values

e)

ASCII values of the input read

17.

Which keyword is used to come out of a loop only for that iteration?

a)

break

b)

continue

c)

return

d)

none of the mentioned

18.

Comment on the following C statement.


int (*a)[7];

a)

An array “a” of pointers

b)

A pointer “a” to an array

c)

A ragged array

d)

None of the mentioned

19.

𝐓𝐮𝐩𝐥𝐞𝐬 𝐜𝐚𝐧 𝐛𝐞 𝐮𝐩𝐝𝐚𝐭𝐞𝐝 𝐚𝐧𝐝 𝐜𝐡𝐚𝐧𝐠𝐞 𝐭𝐡𝐞 𝐯𝐚𝐥𝐮𝐞𝐬 𝐨𝐟 𝐭𝐮𝐩𝐥𝐞 𝐞𝐥𝐞𝐦𝐞𝐧𝐭

a)

True

b)

False

20.

𝐖𝐡𝐚𝐭 𝐭𝐲𝐩𝐞 𝐨𝐟 𝐞𝐫𝐫𝐨𝐫 𝐨𝐜𝐜𝐮𝐫𝐬 𝐢𝐟 𝐰𝐞 𝐭𝐫𝐲𝐢𝐧𝐠 𝐭𝐨 𝐚𝐜𝐜𝐞𝐬𝐬 𝐚𝐧 𝐢𝐧𝐝𝐞𝐱 𝐨𝐮𝐭𝐬𝐢𝐝𝐞 𝐨𝐟 𝐭𝐡𝐞 𝐭𝐮𝐩𝐥𝐞 𝐢𝐧𝐝𝐞𝐱 𝐫𝐚𝐧𝐠𝐞?

a)

𝐓𝐲𝐩𝐞 error

b)

Index Error

c)

Syntax error

d)

Logic error