C++ MCQs with answers Page - 55

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 is the output of this program?

Code:
#include 
using namespace std;
    int main()
    {
        float num0 = 10.6;
        double num1 = 10.6;
        if (num0 == 10.6f)
            cout << "Arun";
        else
            cout << "Sharma";
        return 0;
    }
  • (A) Arun
  • (B) Sharma
  • (C) Compilation Error
  • (D) Runtime Error

A

Admin • 833.24K Points
Coach

Q. What does the following statement mean?

Code:
int (*fp)(char*)
  • (A) function taking a char* argument and returning a pointer to int
  • (B) pointer to a pointer
  • (C) pointer to an array of chars
  • (D) pointer to function taking a char* argument and returns an int

A

Admin • 833.24K Points
Coach

Q. Identify the type of the variables.

Code:
typedef char* CHAR;
    CHAR a,b;
  • (A) char
  • (B) CHAR
  • (C) char*
  • (D) typedef

A

Admin • 833.24K Points
Coach

Q. Which of the following is the correct syntax of including a user defined header files in C++?

  • (A) #include [userdefined]
  • (B) #include <userdefined>
  • (C) #include “userdefined”
  • (D) #include <userdefined.h>

A

Admin • 833.24K Points
Coach

Q. Which of the following is a correct identifier in C++?

  • (A) 7VARNAME
  • (B) 7var_name
  • (C) $var_name
  • (D) VAR_1234

A

Admin • 833.24K Points
Coach

Q. Which of the following is called address operator?

  • (A) *
  • (B) &
  • (C) _
  • (D) %

A

Admin • 833.24K Points
Coach

Q. A language which has the capability to generate new data types are called

  • (A) Encapsulated
  • (B) Extensible
  • (C) Overloaded
  • (D) Reprehensible

A

Admin • 833.24K Points
Coach

Q. Which of the following is called extraction/get from operator?

  • (A) >>
  • (B) <<
  • (C) >
  • (D) <

A

Admin • 833.24K Points
Coach

Q. Which of the following is called insertion/put to operator?

  • (A) <<
  • (B) >>
  • (C) >
  • (D) <

A

Admin • 833.24K Points
Coach

Q. Which of the following is used for comments in C++?

  • (A) // comment
  • (B) // comment */
  • (C) both // comment or /* comment */
  • (D) /* comment */

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