Computer Science and C++ Quiz Answers, Page 3

Question #21
  • What does the code "cout<<(0==0);" print?

    0
    1
    Compiler error: Lvalue required

    Question #22

  • According to the ANSI C++ standard, what does the getch() do?

    Reads in a character
    Checks the keyboard buffer
    Nothing (getch() is not an ANSI C++ function)

    Question #23

  • If the program completes executing successfully, what value should the function main() return?

    0
    1
    void

    Question #24

  • C is to C++ as 1 is to

    What the heck?
    2
    10

    Question #25

  • Which of the following sorts is quickest when sorting the following set: 1 2 3 5 4

    Quick Sort
    Bubble Sort
    Merge Sort

  • Question #26
  • What does the following code do:
    int foo (int x, int y)
    {
            cout << x << y ;
    }
    int c=0;
    foo( c++, c );
    
    Undefined
    01
    00

    Question #27
  • What is the maximum value of an unsigned char?

    255
    256
    128

    Question #28

  • In the following declaration of main, "int main(int argc, char *argv[])", to what does argv[0] usually correspond?

    The first argument passed into the program
    The program name
    You can't define main like that

    Question #29

  • In which header file is isalpha() declared?

    conio.h
    stdio.h
    ctype.h

    Question #30

  • What will happen when the following code is run:
    int x;
    while(x<100)
    {
    cout<<x;
    x++;
    }

    The computer will output "0123...99"
    The computer will output "0123...100"
    The output is undefined

  • Next Answers