C++ MCQ – Basic Objective Questions – Set 2

10 Questions | Total Attempts: 859

SettingsSettingsSettings
C++ MCQ  Basic Objective Questions  Set 2 - Quiz

Online MCQ Quiz on C++ Programming Language This Quiz is for those users who want to test their command over the C++ Programming Language.


Questions and Answers
  • 1. 
    Identify the correct statement
    • A. 

      Programmer can use comments to include short explanations within the source code itself.

    • B. 

      All lines beginning with two slash signs are considered comments.

    • C. 

      Comments very important effect on the behaviour of the program

    • D. 

      All of Above

  • 2. 
    The directives for the preprocessors begin with
    • A. 

      Ampersand symbol (&)

    • B. 

      Two Slashes (//)

    • C. 

      Number Sign (#)

    • D. 

      Less than symbol (

  • 3. 
    The file iostream includes
    • A. 

      The declarations of the basic standard input-output library.

    • B. 

      The streams of includes and outputs of program effect.

    • C. 

      Both of these

    • D. 

      None of these

  • 4. 
    There is a unique function in C++ program by where all C++ programs start their execution
    • A. 

      Start()

    • B. 

      Begin()

    • C. 

      Main()

    • D. 

      Output()

  • 5. 
    Every function in C++ are followed by
    • A. 

      Parameters

    • B. 

      Parenthesis

    • C. 

      Curly braces

    • D. 

      None of these

  • 6. 
    Which of the following is false?
    • A. 

      Cout represents the standard output stream in c++

    • B. 

      Cout is declared in the iostream standard file

    • C. 

      Cout is declared within the std namespace

    • D. 

      None of above

  • 7. 
    Every statement in C++ program should end with
    • A. 

      A full stop (.)

    • B. 

      A Comma (,)

    • C. 

      A Semicolon (;)

    • D. 

      A colon (:)

  • 8. 
    Which of the following statement is true about preprocessor directives?
    • A. 

      These are lines read and processed by the preprocessor

    • B. 

      They do not produce any code by themselves

    • C. 

      These must be written on their own line

    • D. 

      They end with a semicolon

  • 9. 
    A block comment can be written by
    • A. 

      Starting every line with double slashes (//)

    • B. 

      Starting with /* and ending with */

    • C. 

      Starting with //* and ending with *//

    • D. 

      Starting with

  • 10. 
    When writing comments you can
    • A. 

      Use code and /* comment on the same line

    • B. 

      Use code and // comments on the same line

    • C. 

      Use code and //* comments on the same line

    • D. 

      Use code and

Back to Top Back to top