C++ and Computer Science Quiz Answers, Page 1

Question #1
  • What number of digits that can be accurately stored in a float (based on the IEEE Standard 754)?

    6
    38
    An unlimited number

    Question #2

  • Which of the following is evaluated first:

    &&
    ||
    !


    Question #3

  • What does 7/9*9 equal (in C and C++)?

    1
    0.08642
    0

    Question #4

  • Which is not valid in C?

    class aClass{public:int x;};
    /* A comment */
    char x=12;

    Question #5

  • Which of the following is not a valid declaration for main()?

    int main()
    int main(int argc, char *argv[])
    They both work

  • Question #6
  • Evaluate the following as true or false: !(1 &&0 || !1)

    True
    False
    Invalid statement

    Question #7

  • Which command properly allocates memory?

    char *a=new char[20];
    char a=new char[20];
    char a=new char(20.0);

    Question #8

  • What operator is used to access a struct through a pointer?

    ->
    >>
    *

    Question #9

  • Which is not an ANSI C++ function?

    sin()
    kbhit()
    tmpnam()

    Question #10

  • True or false: If you continuously increment a variable, it will become negative?

    True
    False
    It depends on the variable type
    Next Answers