- 1
- 2
- 3
- 4
- Next Page »
A Learning Portal from Recruitment India
What is the ability to group some lines of code that can be included in the program?
specific task
modularization
program control
macros
Answer with explanation
Answer: Option BExplanation
Modularization is also similar to macros but it is used to build large projects.
Workspace
What does derived class does not inherit from the base class?
constructor and destructor
friends
operator = () members
all of the mentioned
Answer with explanation
Answer: Option DExplanation
The derived class inherit everything from the base class except the given things.
Workspace
What are the parts of the literal constants?
integer numerals
floating-point numerals
strings and boolean values
all of the mentioned
Answer with explanation
Answer: Option DExplanation
Because these are the types used to declare variables and so these can be declared as constants.
Workspace
Which other keywords are also used to declare the class other than class?
object
union
struct
both b & c
Answer with explanation
Answer: Option DExplanation
Struct and union take the same definition of class but differs in the access techniques.
Workspace
C++: During a class inheritance in CPP, if the visibility mode or mode of derivation is not provided, then by default visibility mode is___________.
public
protected
private
friend
Answer with explanation
Answer: Option CExplanation
The private keyword specifies that the members are accessible only from member functions and friends of the class.
Workspace
At what point of time a variable comes into existence in memory is determined by its
scope
storage class
data type
all of the above
Answer with explanation
Answer: Option BExplanation
At what point of time a variable comes into existence in memory is determined by its storage class.
Workspace
Which is the correct answer regarding ‘\n’ and endl?
Both are same.
‘\n’and endl both are used to print new line but endl flushes the buffer after printing new line.
‘\n’ and endl both are used to print new line but ‘\n’ flushes the buffer after printing new line.
‘\n’used in C programming while endl used in C++ programming.
Answer with explanation
Answer: Option BExplanation
‘\n’ and endl both are used to print new line but endl flushes the buffer after printing new line.
Workspace
C++ was originally developed by;
Clocksin and Mellish
Donald E. Knuth
Sir Richard Hadlee
Bjarne Stroustrup
Answer with explanation
Answer: Option DExplanation
Before the initial standardization in 1998, C++ was developed by Danish computer scientist Bjarne Stroustrup at Bell Labs since 1979 as an extension of the C language; he wanted an efficient and flexible language similar to C that also provided high-level features for program organization.
Workspace
Which feature of the OOPS gives the concept of reusability?
Abstraction
Encapsulation
Inheritance
None of the above
Answer with explanation
Answer: Option CExplanation
The process of designing a new class (derived) from the existing (base) class to acquire the attributes of the existing is called as inheritance. Inheritance gives the concept of reusability for code/software components.
Workspace
Which is more effective while calling the functions?
call by pointer
call by value
call by reference
none of the mentioned
Answer with explanation
Answer: Option CExplanation
In the call by reference, it will just copy the address of the variable to access it, so it will reduce the memory in accessing it.
Workspace
How many minimum number of functions should be present in a C++ program for its execution?
1
2
3
Answer with explanation
Answer: Option BExplanation
The execution of a C++ program starts from main function hence we require atleast 1 function to be present in a C++ program to execute and i.e. the main function
Workspace
Which looping process checks the test condition at the end of the loop?
for
while
do-while
no looping process checks the test condition at the end
Answer with explanation
Answer: Option CExplanation
The do while loop checks the test condition at the end during the process of execution
Do while loop
Here the set of codes are first processed, the condition given is evaluated.
If the test condition is false even the do while runs atleast once as in do while loop the condition is checked in the last.
Do while name itself tells us that first do then check
Ex
#include<stdio.h>
int main()
{
int i=0;
do
{
printf(“execute\n”);
}
While(i==1);
printf(“not executed\n”);
}
Workspace
When class B is inherited from class A, what is the order in which the constructers of those classes are called
Class A first Class B next
Class B first Class A next
Class B’s only as it is the child class
Class A’s only as it is the parent class
Answer with explanation
Answer: Option AExplanation
Class A first Class B next
Workspace
Which of the following is the most common way of implementing C++?
C++ programs are directly compiled into native code by a compiler
C++ programs are first compiled to intermediate code by a compiler and then executed by a virtual machine
C++ programs are interpreted by an interpreter
A C++ editor directly compiles and executes the program
Answer with explanation
Answer: Option CExplanation
C++ programs are interpreted by an interpreter
Workspace