Home > UGC NET > Computer Science
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

Q 4.

int main()
{
int _ = 10;
int __ = 20;
int ___ = _ + __;
printf(“__%d”,___);
return 0;
}

A)  Compilation Error
B)  Runtime Error
C)  __0
D)  __30
Q 5.

void main()
{
int a = 10.5;
printf(“%d”,a);

}

A)  10.5
B)  10
C)  0
D)  Compilation Error
Q 6.

Which of the following is executed by Preprocess ?

A)  #include<stdio.h>
B)  return 0
C)  void main(int argc , char ** argv)
D)  None of above
Q 7.

What should be the output:
void main()
{
int a = 10/3;
printf(“%d”,a);
}

A)  3.33
B)  3.0
C)  3
D)  0
Q 8.

void main()
{
int a = printf (“goforexams.com”);
printf(“%d”, a);
}

A)  Compilation Error
B)  0
C)  goforexams.com
D)  goforexams.com11
Q 9.

Which programming language is more faster among these?

A)  Java
B)  PHP
C)  C
D)  Visual Basic
Q 10.

//This program is compiled on 32 bit DEV-C++
int main()
{

char *ptr1, *ptr2;
printf(“%d %d”, sizeof(ptr1), sizeof(ptr2));

return 0;
}

A)  1 1
B)  2 2
C)  4 4
D)  Undefined