Home > Computer Science > C++
Q 1.

What following operator is called
?:

A)  Conditional Operator
B)  Scope Resolution Operator
C)  if else o/p
D)  Ternary Operator
Answer & Explanation Answer: Ternary Operator

Explanation:
?: is known as ternary operator. It is the operator that can't be overloaded. This can be used in place of if else conditions.

View Answer   Discuss

MCQ Type: C++, Computer Science, Computer Science, Computer Science, General Knowledge, UGC NET

Q 2.

What is the output of below program ?

int main()
{
if(0)
{
cout<<“Hi”;
}
else
{
cout<<“Bye”;
}
return 0;
}

A)  Hi
B)  Bye
C)  HiBye
D)  Compilation Error
Q 3.

How many loops are there in C++ 98 ?

A)  1
B)  2
C)  3
D)  4
Answer & Explanation Answer: 3

Explanation:
There are three types in loops in C++ 98. After this C++ version, for loop with ranges was added in C++ 11.

View Answer   Discuss

MCQ Type: C++, Computer Science, Computer Science, Computer Science, UGC NET