C++ Programming Fundamentals

Test your knowledge of C++ programming concepts including operators, data types, inheritance, arrays, pointers, and code execution behavior.

20 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

void main() { char *p = "ayqm"; char c; c = ++*p++; printf("%c",c); }

  1. a
  2. b
  3. y
  4. z
Question 2 Multiple Choice (Single Answer)

union a { int a,b; }a1; void main() { a1.a=10; a1.b=20; printf("%d",a1.a); }

  1. unknown symbol ‘a1’
  2. compile error
  3. 10
  4. 20
Question 3 Multiple Choice (Single Answer)

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

  1. 6
  2. 38
  3. An unlimited number
  4. None Of the above
Question 4 Multiple Choice (Single Answer)

C++

  1. 1
  2. 0
  3. Code cannot compile
  4. None of the Above
Question 5 Multiple Choice (Single Answer)

C++

  1. 6
  2. 38
  3. An unlimited number
  4. None of the Above
Question 6 Multiple Choice (Single Answer)

C++

  1. \0
  2. .
  3. \END
  4. None of the Above
Question 7 Multiple Choice (Single Answer)

C++

  1. 5
  2. 1
  3. 3
  4. None of the Above
Question 8 Multiple Choice (Single Answer)

C++

  1. Yes
  2. No
  3. Only optimized compilers will compile C++ code.
  4. None of the Above
Question 9 Multiple Choice (Single Answer)

C++

  1. Breaks out of the if statement
  2. Exits the function
  3. Nothing (Compiler error)
  4. None of the Above
Question 10 Multiple Choice (Single Answer)

C++

  1. Copies "This" into an_array
  2. Adds "This" to the end of an_array
  3. Compares an_array and "This"
  4. None of the Above
Question 11 Multiple Choice (Single Answer)

C++

  1. 10
  2. 11
  3. 1
  4. None of the Above
Question 12 Multiple Choice (Single Answer)

C++

  1. 2
  2. 4
  3. 0
  4. None of the Above
Question 13 Multiple Choice (Single Answer)

C++

  1. Binary Tree
  2. Hash Table
  3. Stack
  4. None of the Above
Question 14 Multiple Choice (Single Answer)

C++

  1. class aclass : public superclass
  2. class aclass inherit superclass
  3. class aclass <-superclass
  4. None of the Above
Question 15 Multiple Choice (Single Answer)

C++

  1. 28
  2. 9
  3. Any of them could be
  4. None of the Above
Question 16 Multiple Choice (Single Answer)

C++

  1. No
  2. Case sensitivity is compiler-determined
  3. Yes
  4. None of the Above
Question 17 Multiple Choice (Single Answer)

C++

  1. unsigned int
  2. char
  3. Float
  4. None of the Above
Question 18 Multiple Choice (Single Answer)

C++

  1. public
  2. protected
  3. guarded
  4. None of the Above
Question 19 Multiple Choice (Single Answer)

C++

  1. &&
  2. ||
  3. !
  4. None of the Above
Question 20 Multiple Choice (Single Answer)

C++

  1. True
  2. False
  3. It depends on the variable type
  4. None of the Above