computer MCQs
10th • Chapter 05
49 Questions TextBook
1
A good problem-solving approach to divide a problem into smaller parts is called?
2
A function is a block of statements that performs a ____ task.
3
Which of the following is mentioned as a built-in function in the text?
4
Functions which are available in the C Standard Library are called?
5
Functions defined by a programmer are known as?
6
One of the primary advantages of functions is the ____ of code.
7
Using functions to separate code for different tasks helps in ____.
A
slowing down the programB
making the program complexC
easier debugging and management 8
What does a function signature define?
A
The logic of the functionB
The variables used inside the functionC
The inputs and output of a functionD
The location of the function in memory 9
The inputs to a function are called its ____.
10
What is the output of a function called?
11
How many values can a function return at most?
D
Depends on the function 12
In the signature 'int square(int);', what is 'int' at the beginning?
D
Data type of a variable 13
The set of statements enclosed within {} in a function definition is called the ____.
14
The 'return' keyword is used to ____.
C
return a value from a function 15
What happens when a 'return' statement is executed in a function?
A
The function continues executionB
The control is transferred back to the calling functionD
A compiler error occurs 16
How do we use a function to perform its programmed task?
D
By including its header file 17
In a function call, the values passed to the function are called ____.
18
The variables in the function definition that receive values are called ____.
19
When variables are passed as arguments to a function, the function works on a ____ of these variables.
20
If the called function's definition appears after the calling function's definition, what is required?
A
A comment explaining the functionB
The function's signature before the callC
Inclusion of a special library 21
In the function 'int add(int x, int y)', x and y are ____.
22
In the statement 'sum = add(n1, n2);', n1 and n2 are ____.
23
Can the names of arguments in a function call be the same as the parameter names in the function definition?
D
It causes a compiler error 24
If you pass variables with the same names as the parameters, the function still uses a ____.
25
The 'main()' function in a C program is an example of a ____ function.
26
What is the purpose of the 'printf' function?
A
To take input from the userB
To display output on the screenC
To perform mathematical calculationsD
To define a new function 27
What is the purpose of the 'scanf' function?
B
To take input from the user 28
Dividing a program into multiple functions improves its ____.
29
Which term refers to the function name, its parameters, and the return type?
30
What does 'reusability' in the context of functions mean?
A
The function can be used only onceB
The same set of statements needs to be written multiple timesC
The function can be called whenever its functionality is neededD
The function reuses variables from other functions 31
In 'float perimeter(float, float);', how many parameters does the function take?
32
The body of a function contains the ____ which are executed.
33
A function call transfers the ____ to the called function.
34
After a called function completes its execution, where does the control transfer back to?
A
The start of the program 35
A function cannot return more than ____ value(s).
36
What is the return type of the function with the signature 'int isVowel(char);'?
37
The function definition contains the actual ____ of the function.
38
If a function has three return statements, how many of them will be executed in a single call?
C
Only the first one encountered 39
Readability of code is improved by ____.
A
using complex variable namesB
writing the entire code in main()C
dividing the program into functionsD
using as few functions as possible 40
What are the two basic types of functions in C?
D
Built-in and User-defined 41
According to the text, handling the complexity of a problem is an advantage of using ____.
42
What is the correct way to call the function defined as 'void showPangram()'?
43
The variables passed to a function are called arguments, while the variables that receive them are called ____.
44
In 'return_type function_name(data_type1, ...);', 'function_name' is the ____.
45
The 'divide and conquer' approach is facilitated in C programming by using ____.
46
The function 'scanf' is used for ____ operations.
47
What will the statement 'return (4, 5);' result in?
A
The function will return 4B
The function will return 5D
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.
49
If a called function is defined before the calling function, is a separate function signature required?