wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

OBCFC 18-7-25

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

Which of the following is the correct syntax to declare a function in C?

a)

function int sum(int, int);

b)

int sum(int, int);

c)

sum int(int, int);

d)

int sum;

2.

Which of the following best describes void return type in a function?

a)

Function returns an integer

b)

Function does not return any value

c)

Function returns nothing or null

d)

Function always exits the program

3.

What happens if the number of arguments in the function call does not match with the number of parameters in the function definition?

a)

Compiler automatically adjusts

b)

Runtime error

c)

Compile-time error

d)

No error

4.

What is a function prototype?

a)

A function with no return type

b)

A function that calls another function

c)

A declaration of a function that tells the compiler about function name, return type, and parameters

d)

A function defined inside another function

5.

Which keyword is used to return a value from a function?

a)

send

b)

exit

c)

return

d)

output

6.

A college uses a program with a function int isPresent(char studentID[]) that returns 1 for present and 0 for absent. Which control structure is most suitable to be used with this function?

a)

switch-case

b)

if-else

c)

goto

d)

while loop

7.

You are building a simple calculator in C with separate functions like add(), subtract(), multiply(), and divide(). Which of the following best describes the reason for using multiple functions?

a)

It increases memory usage

b)

It helps in modular design and reusability

c)

It reduces the need for input

d)

It avoids use of loops

8.

A C program is designed to monitor room temperature using a function float getTemperature(). Which of the following best explains why this function should return a value?

a)

To reuse the temperature data later in the program

b)

To avoid using global variables

c)

To print the temperature immediately

d)

To store sensor ID

9.

What will be the output of the following code snippet?

a)

1 2 3 None

b)

2

c)

2 3 None

d)

None

10.

Uses of function

a)

Helps to avoid repeating a set of statements many times

b)

Enhances the logical clarity of the program,Makes the debugging task easier

c)

Helps to avoid repeated programming across programs

d)

All of the above