Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

51.

How can you access the arguments that are manipulated in the function?(a) va_list(b) arg_list(c) both va_list & arg_list(d) vg_listThe question was asked in an international level competition.This intriguing question originated from Unspecified Number of Arguments topic in division Functions, Namespaces & Exceptions in C++ of C++

Answer»

Correct answer is (a) va_list

The BEST explanation: va_list is PROVIDED by C++ to ACCESS manipulated ARGUMENTS in FUNCTION.

52.

Which is used to keep the call by reference value as intact?(a) static(b) const(c) absolute(d) virtualI have been asked this question during an internship interview.Query is from Argument Passing in chapter Functions, Namespaces & Exceptions in C++ of C++

Answer»

The correct option is (b) const

The EXPLANATION is: Because const will not CHANGE the value of the VARIABLES during the EXECUTION.

53.

What is the general syntax for accessing the namespace variable?(a) namespace::operator(b) namespace,operator(c) namespace#operator(d) namespace$operatorThis question was addressed to me during an interview for a job.My question is taken from Namespaces in division Functions, Namespaces & Exceptions in C++ of C++

Answer»

Correct choice is (a) namespace::operator

Easiest explanation - To access VARIABLES from namespace we use following syntax.

namespace :: VARIABLE;

General syntax:

namespace X{ inta;}

cout<

54.

What is the mandatory part to present in function pointers?(a) &(b) return values(c) data types(d) $The question was asked during an online interview.I need to ask this question from Pointer to Function in section Functions, Namespaces & Exceptions in C++ of C++

Answer»

Correct option is (C) DATA types

The explanation is: The data types are mandatory for DECLARING the variables in the function pointers.

55.

An inline function is expanded during ______________(a) compile-time(b) run-time(c) never expanded(d) end of the programI got this question in an international level competition.This interesting question is from Functions topic in chapter Functions, Namespaces & Exceptions in C++ of C++

Answer» RIGHT ANSWER is (a) compile-time

The EXPLANATION: An inline function is EXPANDED during the compile-time of a program.
56.

What is the use of Namespace?(a) To encapsulate the data(b) To structure a program into logical units(c) Encapsulate the data & structure a program into logical units(d) It is used to mark the beginning of the programI got this question in an online quiz.I'd like to ask this question from Namespaces topic in section Functions, Namespaces & Exceptions in C++ of C++

Answer» CORRECT option is (B) To structure a program into LOGICAL UNITS

Best explanation: The main aim of the NAMESPACE is to understand the logical units of the program and to make the program so robust.
57.

How many types of macros are there in c++?(a) 1(b) 2(c) 3(d) 4I got this question in a job interview.The query is from Macros in portion Functions, Namespaces & Exceptions in C++ of C++

Answer»

Right option is (b) 2

Best EXPLANATION: There are TWO TYPES of macros. They are object-like and function-like.

58.

Where does the return statement returns the execution of the program?(a) main function(b) caller function(c) same function(d) block functionThe question was asked in an internship interview.Question is from Value Return topic in chapter Functions, Namespaces & Exceptions in C++ of C++

Answer»

Right answer is (B) caller function

Explanation: The EXECUTION of the PROGRAM is returned to the point from where the function was called and the function from which this function was called is KNOWN as caller function.

59.

Where does the execution of the program starts?(a) user-defined function(b) main function(c) void function(d) else functionThe question was asked in unit test.This key question is from Function Declarations in section Functions, Namespaces & Exceptions in C++ of C++

Answer»

Correct CHOICE is (b) main function

To explain: Normally the EXECUTION of the PROGRAM in c++ STARTS from main only.