C++ Programming Fundamentals

Test your knowledge of C++ programming concepts including operator overloading, constructors, STL, access specifiers, and basic C/C++ syntax.

14 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

main() { char s1[]=“Cisco”; char s2[]= “systems”; printf(“%s”,s1); }

  1. systems
  2. Cisco
  3. Null
  4. error
Question 2 Multiple Choice (Single Answer)

#define TRUE 0 // some code while(TRUE) { // some code }

  1. infinite loop
  2. Error
  3. This will not go into the loop as TRUE is defined as 0.
  4. 0
Question 3 Multiple Choice (Single Answer)

main() { int x=10, y=15; x = x++; y = ++y; printf(“%d %dn”,x,y); }

  1. 10,16
  2. 11,15
  3. 10,15
  4. 11,16
Question 4 Multiple Choice (Single Answer)

main() { int a=0; if(a==0) printf(“Cisco Systemsn”); printf(“Cisco Systemsn”); }

  1. Two lines with “Cisco Systems” will be printed.
  2. Compile error
  3. run time error
  4. Cisco Systemsn
Question 5 Multiple Choice (Single Answer)

Which of the following languages is a subset of C++ language?

  1. C language
  2. Java Language
  3. C# language
  4. B language
Question 6 Multiple Choice (Single Answer)

Which of the following correctly describes C++ language?

  1. Statically typed language
  2. Dynamically typed language
  3. Both Statically and dynamically typed language
  4. Type-less language
Question 7 Multiple Choice (Single Answer)

Which of the following keyword supports dynamic method resolution?

  1. Abstract
  2. Virtual
  3. Dynamic
  4. Typeid
Question 8 Multiple Choice (Single Answer)

Which of the following language is not supported by C++?

  1. Exception Handling
  2. Reflection
  3. Operator Overloading
  4. Namespaces
Question 9 Multiple Choice (Single Answer)

Which of the following language feature is not an access specifier in C++?

  1. Public
  2. Private
  3. Protected
  4. Internal
Question 10 Multiple Choice (Single Answer)

If X is the name of the class, what is the correct way to declare copy constructor of X?

  1. X(X arg)
  2. X(X* arg)
  3. X(const X* arg)
  4. X(const X& arg)
Question 11 Multiple Choice (Single Answer)

What does STL stand for?

  1. Simple Template Library
  2. Standard Template Library
  3. Static Type Library
  4. Single Type-based Library
Question 12 Multiple Choice (Single Answer)

Which of the following is the most common way of implementing C++?

  1. C++ programs are directly compiled into native code by a compiler
  2. C++ programs are first compiled to intermediate code by a compiler and then executed by a virtual machine
  3. C++ programs are interpreted by an interpreter
  4. A C++ editor directly compiles and executes the program
Question 13 Multiple Choice (Single Answer)

What is the implicit pointer that is passed as the first argument for nonstatic member functions?

  1. ‘self’ pointer
  2. std::auto_ptr pointer
  3. ‘Myself’ pointer
  4. ‘this’ pointer
Question 14 Multiple Choice (Single Answer)

Which of the following operator cannot be overloaded?

  1. = (assignment operator)
  2. == (equality operator)
  3. –> (row operator)
  4. :: (scope resolution operator)