C++ MCQs with answers Page - 94

Here, you will find a collection of MCQ questions on C++. Go through these questions to enhance your preparation for upcoming examinations and interviews.

To check the correct answer, simply click the View Answer button provided for each question.

Have your own questions to contribute? Click the button below to share your MCQs with others!

+ Add Question

A

Admin • 833.24K Points
Coach

Q. What should be the output?

Code:
int main() {
    int new = -10;
    cout<<"new is: "<<new;
    return 0;
}
  • (A) new is: -10
  • (B) new is: 0
  • (C) new is: 10
  • (D) Compilation Error

A

Admin • 833.24K Points
Coach

Q. What should be the output of below program?

Code:
int main()
{
 cout<<"mcqbuddy";;;;;  
 return 0;                                                                          
}
  • (A) mcqbuddy
  • (B) mcqbyddy;;;;
  • (C) Runtime Error
  • (D) Compilation Error

A

Admin • 833.24K Points
Coach

Q. Can any function call itself?

  • (A) Yes
  • (B) No
  • (C) Compilation Error
  • (D) Runtime Error

A

Admin • 833.24K Points
Coach

Q. Can a Structure contain pointer to itself?

  • (A) Yes
  • (B) No
  • (C) May Be
  • (D) Can not say

A

Admin • 833.24K Points
Coach

Q. Can a for loop contain another for loop?

  • (A) Yes
  • (B) No
  • (C) May Be
  • (D) Can not say

A

Admin • 833.24K Points
Coach

Q. What is output of below program?

Code:
int main()
{
  int a=10;
  int b,c;
  b = a++;
  c = a;
  cout<<a<<b<<c;
  return 0;
}
  • (A) 101010
  • (B) 101011
  • (C) 111111
  • (D) 111011

A

Admin • 833.24K Points
Coach

Q. What is Self Referencial Structure?

  • (A) Structure which contains pointers
  • (B) Structure which has pointer to itself
  • (C) Structure which contains another structure
  • (D) None of these

A

Admin • 833.24K Points
Coach

Q. Which one is more faster?
A - #include <iostream.h>
B - #include "iostream.h"

  • (A) A
  • (B) B
  • (C) Both A and B
  • (D) Depends on Compiler

A

Admin • 833.24K Points
Coach

Q. What is Singleton class?

  • (A) We cant create object
  • (B) We can create 1 object
  • (C) We can create max 256 objects
  • (D) We can create n number of object

Add MCQ in this Category

If you want to share an MCQ question in this category, it's a great idea! It will be helpful for many other students using this website.

Share Your MCQ