C++ Programming Basics
Test your knowledge of C++ programming fundamentals including syntax, data structures, control flow, and memory management.
Questions
Question 1 Multiple Choice (Single Answer)
C++
- sin()
- kbhit()
- tmpnam()
- None of the Above
Question 2 Multiple Choice (Single Answer)
C++
- char *a=new char[20];
- char a=new char[20];
- char a=new char(20.0);
- None of the Above
Question 3 Multiple Choice (Single Answer)
C++
- class aClass{public:int x;};
- /* A comment */
- char x=12;
- None of the Above
Question 4 Multiple Choice (Single Answer)
C++
- int main()
- int main(int argc, char *argv[])
- They both work
- None of the Above
Question 5 Multiple Choice (Single Answer)
C++
- True
- False
- Invalid Statement
- None of the Above
Question 6 Multiple Choice (Single Answer)
C++
- The snippet is illegal
- It loops forever
- It is ignored by compiler, but it is not illegal
- None of the Above
Question 7 Multiple Choice (Single Answer)
C++
- Constructor
- Destructor
- Constitutor
- None of the Above
Question 8 Multiple Choice (Single Answer)
C++
- 1
- 0
- Code cannot compile
- None of the Above
Question 9 Multiple Choice (Single Answer)
C++
- 6
- 38
- An unlimited number
- None of the Above
Question 10 Multiple Choice (Single Answer)
C++
- \0
- .
- \END
- None of the Above
Question 11 Multiple Choice (Single Answer)
C++
- 5
- 1
- 3
- None of the Above
Question 12 Multiple Choice (Single Answer)
C++
- Yes
- No
- Only optimized compilers will compile C++ code.
- None of the Above
Question 13 Multiple Choice (Single Answer)
C++
- Breaks out of the if statement
- Exits the function
- Nothing (Compiler error)
- None of the Above
Question 14 Multiple Choice (Single Answer)
C++
- Copies "This" into an_array
- Adds "This" to the end of an_array
- Compares an_array and "This"
- None of the Above
Question 15 Multiple Choice (Single Answer)
C++
- 10
- 11
- 1
- None of the Above
Question 16 Multiple Choice (Single Answer)
C++
- 2
- 4
- 0
- None of the Above
Question 17 Multiple Choice (Single Answer)
C++
- Binary Tree
- Hash Table
- Stack
- None of the Above
Question 18 Multiple Choice (Single Answer)
C++
- class aclass : public superclass
- class aclass inherit superclass
- class aclass <-superclass
- None of the Above
Question 19 Multiple Choice (Single Answer)
C++
- 28
- 9
- Any of them could be
- None of the Above
Question 20 Multiple Choice (Single Answer)
C++
- No
- Case sensitivity is compiler-determined
- Yes
- None of the Above