Programming Test 4

20 Questions | Total Attempts: 68

SettingsSettingsSettings
Please wait...
Programming Quizzes & Trivia

Questions and Answers
  • 1. 
    What is the only function all C++ programs must contain?
    • A. 

      Start()

    • B. 

      System()

    • C. 

      Main()

    • D. 

      Program()

  • 2. 
    What punctuation ends most lines of C++ code?
    • A. 

      . (dot)

    • B. 

      ; (semi-colon)

    • C. 

      : (colon

    • D. 

      ' (single quote

  • 3. 
    Which of the following is not a correct variable type?
    • A. 

      Float

    • B. 

      Real

    • C. 

      Int

    • D. 

      Double

  • 4. 
    Which of the following is the correct operator to compare two variables?
    • A. 

      :=

    • B. 

      =

    • C. 

      Equal

    • D. 

      ==

  • 5. 
    Which of the following is the boolean operator for logical-and?
    • A. 

      &

    • B. 

      &&

    • C. 

      |

    • D. 

      |&

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

      Parameters

    • B. 

      Parenthesis

    • C. 

      Curly braces

    • D. 

      None of these

  • 7. 
    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

  • 8. 
      Observe the following statements and decide what do they do.   string mystring;   getline(cin, mystring);
    • A. 

      reads a line of string from cin into mystring

    • B. 

      reads a line of string from mystring into cin

    • C. 

      Cin can’t be used this way

  • 9. 
    Cin extraction stops execution as soon as it finds any blank space character
    • A. 

      True

    • B. 

      False

  • 10. 
    Regarding stringstream identify the invalid statement
    • A. 

      Stringstream is defined in the header file

    • B. 

      It allows string based objects treated as stream

    • C. 

      It is especially useful to convert strings to numerical values and vice versa.

    • D. 

      None of above

  • 11. 
    Which of the header file must be included to use stringstream?
    • A. 

    • B. 

    • C. 

    • D. 

  • 12. 
    Which of the following header file does not exist?
    • A. 

    • B. 

    • C. 

    • D. 

  • 13. 
    If you use same variable for two getline statements
    • A. 

      Both the inputs are stored in that variable

    • B. 

      The second input overwrites the first one

    • C. 

      The second input attempt fails since the variable already got its value

    • D. 

      You can not use same variable for two getline statements

  • 14. 
    The “return 0;” statement in main function indicates
    • A. 

      The program did nothing; completed 0 tasks

    • B. 

      The program worked as expected without any errors during its execution

    • C. 

      Not to end the program yet.

    • D. 

      None of above

  • 15. 
    Which of the following is not a reserve keyword in C++?
    • A. 

      mutable

    • B. 

      default

    • C. 

      Readable

    • D. 

      volatile

  • 16. 
    The size of following variable is not 4 bytes in 32 bit systems
    • A. 

      int

    • B. 

      Long int

    • C. 

      Short int

    • D. 

      float

  • 17. 
    Identify the correct statement regarding scope of variables
    • A. 

      Global variables are declared in a separate file and accessible from any program.

    • B. 

      Local variables are declared inside a function and accessible within the function only.

    • C. 

      Global variables are declared inside a function and accessible from anywhere in program.

    • D. 

      Global variables are declared inside a function and accessible from anywhere in program.

  • 18. 
    The tags used for specifying fonts in HTML are (i) <B> (ii) <I> (iii) <U> (iv) <L>
    • A. 

      (i) and (ii)

    • B. 

      (i) and (iii)

    • C. 

      (ii) and (iv)

    • D. 

      (i),(ii) and (iii)

  • 19. 
    XML stands for
    • A. 

      Extra Markup Language

    • B. 

      Excellent Markup Links

    • C. 

      Extended Markup Language

    • D. 

      Extended Marking Links

  • 20. 
    XML uses
    • A. 

      User define tags

    • B. 

      Pre-defined tags

    • C. 

      Both predefined and user-defined tags

    • D. 

      Extended tags used in HTML and makes them powerful