Search This Blog

Thursday, 13 January 2022

UNIT 05. FUNCTIONS - MCQs - Computer Science For Class X

GO TO INDEX

Computer Science For Class X
Unit 05: Functions
Multiple Choice Questions And Fill In The Blanks

By Mrs. Ayesha Arif
Vice Principal
(Jauhar Progressive School)


Multiple Choice Questions (MCQs)
A. ENCIRCLE THE CORRECT ANSWER:
1. The functions that are defined by the programmer are called:
a. Built-In function
b. User-defined-function ✓
c. Sub function
d. Function

2. A programmer creates a function for a particular task and the programmer wants to include that function in program. Which extension is required to save that function?
a. .obj
b. .h ✓
c. .cpp
d. .exe

3. In C++, int main( ) returns which data type value by default?
a. float
b. int ✓
c. char
d. double

4. The parameters specified is the function header are called:
a. formal parameters ✓
b. actual parameters
c. default parameters
d. command line parameters

5. The word “prototype” means:
a. Declaration ✓
b. Calling
c. Definition
d. Both a & b

6. The function prototype consists of:
a. Name of function
b. the parameters are passed to the function
c. The value return from function
d. All of these ✓

7. All variables declared in function definition are called:
a. Local variable ✓
b. Instance variable
c. Global variable
d. Static variable

8. Which are not the built-In function?
a. sqrt( )
b. time( ) ✓
c. exp( )
d. sin( )

9. A group of statements written to perform specific task is called _____.
a. Program
b. function ✓
c. statement
d. variable

10. Functions are divided into ____________ sections.
a. 4
b. 3 ✓
c. 2
d. 1

11. Functions in C++ helps the programmer to manage the ___________ of a large program.
a. code ✓
b. declaration
c. statement
d. variable

12. There are ___________ categories of function.
a. 4
b. 3
c. 2 ✓
d. 1

13. Function ______tells the compiler about the function name, return types and parameters types.
a. Declaration ✓
b. Calling
c. Definition
d. Both a & b

14. Function _________ is to invoke the code of function by name.
a. Declaration
b. Call ✓
c. Definition
d. Both a & b

15. In C++ , _____________ functions are already declared in header file.
a. user-defined
b. pre-defined ✓
c. statements
d. Both a & b

Fill In The Blanks:
1. A programmer can write his/her own function which is called User-defined function.
2. A set of statements written to perform a specific task and having a unique name is called a function.
3. In structured programming, the complicated and large program coding is broken down into smaller modules which are called subprograms.
4. In C++, subprograms are called functions.
5. Every program has at least one main( ) function in C++.
6. When the program starts, the main( ) function is called for execution.
7. The pre-define functions are the part of every high-level programming language.
8. Predefined functions are also known as System-defined or library functions.
9. Predefined functions do not need to be declared and defined.
10. Many pre-define functions need proper header file by using #include pre-processor directive.
12. The definitions of many common functions are found in the cmath and cstdlib libraries.
13. User-defined-functions need declaration and definition.
14. Multiply ( ), sum( ), average( ) may be the example of User-define functions.
15. All predefined functions can be used simply by calling the function like sqrt(), strcpy(), touppero, pow() etc.
16. A function without its definition (code block) is known as a function declaration or function prototype.
17. Function declaration or function prototype is declared before the main( ) function.
18. A function declaration ends with statement terminator (;).
19. Return Data Type shows the data type of value returned by function.
20. Return data type may be int, float, double and char data type.
21. If no value is returned by the function in that case keyword "void" is used.
22. Function Name specifies the name of function.
23. Parameters define the list of data types of function parameters that are to be passed to the function.
24. Parameters are separated by (syntax) commas.
25. Parameters are also known as arguments.
26. If there is no parameter in function, programmer uses keyword "void".
27. In function declaration, statement terminator must be used at the end.
28. Function definition has a function header and a body or code block.
29. Body of the function includes statements in braces.
30. Function definition may be defined before or after the main function.
31. Function's braces will be empty, if the function is without return value and no arguments then it is called by its name.
32. An argument is a part of data passed to the function.
33. Passing actual values to function as arguments with function call statement are known as actual parameters.
34. Actual parameters may be variables or constants.
35. The receiving variables of the header of function definition are called the formal parameters of the function.
36. Global variables are declared outside of the main function.
37. Global variable is also known as external variable.

Source: Special Thanks To Sir Syed Arif Ali

No comments:

Post a Comment