C++ Programming Quiz


Play this c++ quiz that will help you to excel in C++ certification exams, placements etc. This C++ programming quiz consist of 10 questions that you need to solve in 10 minutes. We’ve specially designed this quiz so that you can quickly acquaint to the pattern of questions you can be asked in placement drives, certification exams etc. This C++ programming test enables you to assess your knowledge of C++ programming.

Take the Free Practice Test



C++ MCQs

Practice C++ MCQ Questions, which will help you to understand C++ programming related concepts and also helps you to prepare for placements, technical rounds, interviews, competitive exams etc.

C++ Quiz

Try Free C++ Quiz, to start a quiz you need to login first, after login you will get start quiz button and then by clicking on that you can start quiz. You will get 10 Minutes to answer all questions.

C++ Quiz

1. What will be the output of this program?

        
Note:Includes all required header files

using namespace std;
   int main()
   {
       int find[] = {1, 2, 3, 4};
       int *p = (find + 1);
       cout << *p;
       return 0;
   }

1
2
3
4

2. What is this operator called ?:?

conditional
relational
casting operator
unrelational

3. Dereference operator is also called as

pointer
Reference operator
Offset operator
Deoffset operator

4. What is the output of this program?

#include <iostream>

using namespace std;
int main()
{
    char *ptr;
    char Str[] = "abcdefg";
    ptr = Str;
    ptr += 5;
    cout << ptr;
    return 0;

}  

fg
cdef
defg
abcd

5. Assume that the random number generating function - rand( ), returns an integer between 0 and 10000 (both inclusive). If you want to simulate the throwing of a die using this random function, use the expression

rand ( ) % 6
rand ( ) % 6 + 1
rand ( ) % 5 + 1
None of the above

6. Which of the following function declaration is/are incorrect?

int Sum(int a, int b = 2, int c = 3);
int Sum(int a = 5, int b);
int Sum(int a = 0, int b, int c = 3);
Both B and C are incorrect.

7. ___________ word is used to ignore the unpacking of some elements of a tuple.

stop
ignore
cancel
remain

8. What is the default value of a bitset?

0
1
-1
infinite

9. Which member function is used to determine whether the stream object is currently associated with a file?

is_open
Buf
String
None of the above

10. A References is :

A variable that holds memory address.
A Alias to an existing variable.
Alias to an existing variable and holds memory address.
None of the above

Results