Functions

1. A function cannot be defined inside –

  • Another function
  • A program
  • A class
  • None of these
Answer
Another function

2. Which C libram file declare functions for processing strings ?

  • ¬†< Stdlib.h >
  • ¬†< String.h >
  • ¬†< time.h >
  • ¬†< Stdio.h >
Answer
 < String.h >

3. Not initializing a reference variable will cause :

  • Termination of program
  • Overloading
  • A Syntax error
  • ¬†Nothing
Answer
A Syntax error 

4. Int & x ; this syntax is used when :

  • ¬†X is passed by reference
  • X is declared outside the function
  • X is passed by value
  • ¬†None of the above
Answer
 X is passed by reference 

5. Standard C library file < stdib.h ) is used for :

  • Declares data function
  • Declares time function
  • Declares a mathematical function
  • Declares a utility function
Answer
Declares a utility function 

6. Iteration used a repetition structure whereas recursion uses :

  • Selection Structure
  • Controlling Structure
  • ¬†Sorting Structure
  • All of these
Answer
Selection Structure

7. A function is invoked by a :

  • Operator call
  • An object call
  • Function call
  • None of these
Answer
Function call

8. Which C ++ function is used for finding absolute values?

  • Expo
  • Fabs
  • ¬†atan
  • ¬†Pow
Answer
Fabs

9. Pre-defined function and other program elements are accessed through :

  • ¬†Classes
  • Operator
  • Header files
  • All of these
Answer
Header files 

10. In which circumstances recursion function is called?

  • For calling maths function
  • ¬†To calling input and output stream
  • To solve a problem
  • All of the above
Answer
To solve a problem

11. Void function is also called as :

  • Subroutine
  • Procedure
  • Both a and b
  • Terminator
Answer
Both a and b

12. Which function is known as the standard library function?

  • Void
  • Sort
  • ¬†Maths
  • sqrt
Answer
 Maths  

13. Strand function is used for :

  • ¬†Including the timestamps
  • Getting randomizing effect
  • Calling a maths function
  • ¬†None of these
Answer
Getting randomizing effect

14. Like swap ( ) function if we want to change the value of the actual parameter we must call parameters :

  • By reference
  • ¬†By value
  • Outside the function
  • None of these
Answer
By reference 

15. INT – MAX Constant is defined in which header file?

  • ¬† < time .h
  • ¬†< math.h >
  • < limits .h
  • ¬†Stdlib.h
Answer
< limits .h  

16. Recursive alt is also known as

  • Operator call
  • ¬†Recursion step
  • Complex calls
  • ¬†None of these
Answer
 Recursion step

17. Which of the following is not a maths function

  • Pow ( )
  • Log ( )
  • Time ( )
  • Expo ( )
Answer
Time ( )

18. Function body is also referred as :

  • ¬†Block
  • Compound statement
  • Class
  • ¬†All of these
Answer
 Block 

19. Default return type for every function is :

  • String
  • Float
  • Char
  • Int
Answer
Int

20. How many storage classes specifies are offered by C ++?

  • ¬†3
  • ¬†4
  • ¬†5
  • 2
Answer
5

21. Which from following is not a storage class specifier in C++:

  • Mat
  • Extern
  • Register
  • ¬†Auto
Answer
Mat 

22. A function that needs no return value is called :

  • ¬†Finite function
  • Void function
  • ¬†Infinite function
  • ¬†All of these
Answer
Void function

23. Modules in C ++ are called :

  • ¬†Classes
  • Functions
  • Both a and b
  • Programs
Answer
Both a and b 

Leave a Comment