functions in c++

MCQsQuestion.com has 13 Question/Answers about Topic functions in c++

Which function is known as standard library function?

Which function is known as standard library function?
  • A. maths
  • B. main
  • C. sqrt
  • D. void
  • Correct Answer: Option B

A function in C++ that does not return a value is declared with

A function in C++ that does not return a value is declared with
  • A. Empty return type
  • B. Void return type
  • C. Endl return type
  • D. Getchar return type
  • Correct Answer: Option B

Maths function acos (x) stands for

Maths function acos (x) stands for
  • A. Inverse Cosine of x
  • B. Inverse Sine of x
  • C. Inverse Tangent of x
  • D. Floor of x
  • Correct Answer: Option A

A function is invoked by a

A function is invoked by a
  • A. Function call
  • B. Operator call
  • C. an object call
  • D. None of them
  • Correct Answer: Option A

A function that tells compiler to replace each call with explicit code, is called

A function that tells compiler to replace each call with explicit code, is called
  • A. Square function
  • B. Inline function
  • C. Outside function
  • D. None of them
  • Correct Answer: Option B

For accessing a global variable when a local variable of same name is in scope, C++ provides a

For accessing a global variable when a local variable of same name is in scope, C++ provides a
  • A. Function for accessing
  • B. An operator for accessing
  • C. A class for accessing
  • D. None of them
  • Correct Answer: Option B

All variables declared in function definition are called

All variables declared in function definition are called
  • A. Protected variables
  • B. Local variable
  • C. Global Variables
  • D. Private variable
  • Correct Answer: Option B

Not initializing a reference variable will cause

Not initializing a reference variable will cause
  • A. A syntax error
  • B. Termination of program
  • C. Overloading
  • D. Nothing
  • Correct Answer: Option A

Why a parameter that is passed by value is referred as read only?

Why a parameter that is passed by value is referred as read only?
  • A. Because parameters are passed outside function
  • B. Because parameters cannot be changed in pass by value method
  • C. Because parameters changes its type to another type in call by value method
  • D. All of them
  • Correct Answer: Option B

INT_MAX constant is defined in which header file?

INT_MAX constant is defined in which header file?
  • A. None
  • B. None
  • C. None
  • D. None
  • Correct Answer: Option B

To declare identifiers for variables and functions of static storage class, which keywords are used?

To declare identifiers for variables and functions of static storage class, which keywords are used?
  • A. extern keyword
  • B. static keyword
  • C. global keyword
  • D. Both A and B
  • Correct Answer: Option D

A function that is called by itself, either directly or indirectly is called as

A function that is called by itself, either directly or indirectly is called as
  • A. Super function
  • B. Recursive function
  • C. Main function
  • D. All of them
  • Correct Answer: Option B

Iteration uses a repetition structure whereas recursion uses

Iteration uses a repetition structure whereas recursion uses
  • A. Sorting structure
  • B. Selection structure
  • C. Controlling structure
  • D. All of them
  • Correct Answer: Option B