computer MCQs

10th • Chapter 05

49 Questions TextBook
1

A good problem-solving approach to divide a problem into smaller parts is called?

A
Top-down design
B
Bottom-up design
C
Divide and conquer
D
Procedural programming
2

A function is a block of statements that performs a ____ task.

A
general
B
particular
C
complex
D
simple
3

Which of the following is mentioned as a built-in function in the text?

A
add()
B
main()
C
printf()
D
isPrime()
4

Functions which are available in the C Standard Library are called?

A
User-defined functions
B
Standard functions
C
Built-in functions
D
Library functions
5

Functions defined by a programmer are known as?

A
Custom functions
B
User-defined functions
C
Programming functions
D
Main functions
6

One of the primary advantages of functions is the ____ of code.

A
reusability
B
readability
C
complexity
D
security
7

Using functions to separate code for different tasks helps in ____.

A
slowing down the program
B
making the program complex
C
easier debugging and management
D
reducing reusability
8

What does a function signature define?

A
The logic of the function
B
The variables used inside the function
C
The inputs and output of a function
D
The location of the function in memory
9

The inputs to a function are called its ____.

A
arguments
B
return values
C
variables
D
parameters
10

What is the output of a function called?

A
result
B
return value
C
output parameter
D
final value
11

How many values can a function return at most?

A
One
B
Two
C
As many as needed
D
Depends on the function
12

In the signature 'int square(int);', what is 'int' at the beginning?

A
Parameter type
B
Function name
C
Return type
D
Data type of a variable
13

The set of statements enclosed within {} in a function definition is called the ____.

A
signature
B
body
C
header
D
footer
14

The 'return' keyword is used to ____.

A
start a function
B
declare a variable
C
return a value from a function
D
print a value
15

What happens when a 'return' statement is executed in a function?

A
The function continues execution
B
The control is transferred back to the calling function
C
The program terminates
D
A compiler error occurs
16

How do we use a function to perform its programmed task?

A
By defining it
B
By declaring it
C
By calling it
D
By including its header file
17

In a function call, the values passed to the function are called ____.

A
parameters
B
arguments
C
references
D
data types
18

The variables in the function definition that receive values are called ____.

A
arguments
B
parameters
C
placeholders
D
receivers
19

When variables are passed as arguments to a function, the function works on a ____ of these variables.

A
reference
B
pointer
C
copy
D
original value
20

If the called function's definition appears after the calling function's definition, what is required?

A
A comment explaining the function
B
The function's signature before the call
C
Inclusion of a special library
D
Nothing is required
21

In the function 'int add(int x, int y)', x and y are ____.

A
arguments
B
return types
C
function names
D
parameters
22

In the statement 'sum = add(n1, n2);', n1 and n2 are ____.

A
parameters
B
return values
C
arguments
D
declarations
23

Can the names of arguments in a function call be the same as the parameter names in the function definition?

A
Yes, always
B
No, never
C
Yes, it is possible
D
It causes a compiler error
24

If you pass variables with the same names as the parameters, the function still uses a ____.

A
global version
B
reference
C
copy of the variables
D
static version
25

The 'main()' function in a C program is an example of a ____ function.

A
built-in
B
user-defined
C
standard library
D
pre-defined
26

What is the purpose of the 'printf' function?

A
To take input from the user
B
To display output on the screen
C
To perform mathematical calculations
D
To define a new function
27

What is the purpose of the 'scanf' function?

A
To display output
B
To take input from the user
C
To format text
D
To stop the program
28

Dividing a program into multiple functions improves its ____.

A
execution speed
B
complexity
C
readability
D
size
29

Which term refers to the function name, its parameters, and the return type?

A
Function body
B
Function definition
C
Function signature
D
Function call
30

What does 'reusability' in the context of functions mean?

A
The function can be used only once
B
The same set of statements needs to be written multiple times
C
The function can be called whenever its functionality is needed
D
The function reuses variables from other functions
31

In 'float perimeter(float, float);', how many parameters does the function take?

A
One
B
Two
C
Three
D
Zero
32

The body of a function contains the ____ which are executed.

A
declarations
B
signatures
C
set of statements
D
return types
33

A function call transfers the ____ to the called function.

A
data
B
variables
C
control
D
memory
34

After a called function completes its execution, where does the control transfer back to?

A
The start of the program
B
The operating system
C
The calling function
D
The end of the program
35

A function cannot return more than ____ value(s).

A
one
B
two
C
three
D
four
36

What is the return type of the function with the signature 'int isVowel(char);'?

A
char
B
void
C
float
D
int
37

The function definition contains the actual ____ of the function.

A
call
B
logic
C
signature
D
return value
38

If a function has three return statements, how many of them will be executed in a single call?

A
All three
B
The first and the last
C
Only the first one encountered
D
Two
39

Readability of code is improved by ____.

A
using complex variable names
B
writing the entire code in main()
C
dividing the program into functions
D
using as few functions as possible
40

What are the two basic types of functions in C?

A
Internal and External
B
System and Custom
C
Static and Dynamic
D
Built-in and User-defined
41

According to the text, handling the complexity of a problem is an advantage of using ____.

A
variables
B
loops
C
functions
D
data types
42

What is the correct way to call the function defined as 'void showPangram()'?

A
showPangram;
B
call showPangram();
C
showPangram();
D
void showPangram();
43

The variables passed to a function are called arguments, while the variables that receive them are called ____.

A
receivers
B
containers
C
parameters
D
holders
44

In 'return_type function_name(data_type1, ...);', 'function_name' is the ____.

A
function identifier
B
return value
C
parameter
D
function type
45

The 'divide and conquer' approach is facilitated in C programming by using ____.

A
header files
B
pointers
C
functions
D
structures
46

The function 'scanf' is used for ____ operations.

A
output
B
string
C
mathematical
D
input
47

What will the statement 'return (4, 5);' result in?

A
The function will return 4
B
The function will return 5
C
A compiler error
D
The function will return both 4 and 5
48

Even if parameter names and argument names are the same, the variables used in the function are a ____ of the originals.

A
pointer
B
reference
C
copy
D
link
49

If a called function is defined before the calling function, is a separate function signature required?

A
Yes, always
B
It is good practice
C
No, it is not required
D
Yes, for clarity