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. Which of the following is not Arithmetic Operators?

++
--
**
%

2. What is the output of this program?

#include <iostream>
using namespace std;

int &LFC()
{
    int p = 10;
    return p;
}
int main()
{
    LFC() = 30;
    cout << LFC();
    return 0;
}

May cause runtime error
May cause compiler error
Always works fine
0

3. What is the output of this program?

#include <iostream>
using namespace std;
class team
{ 
    public : int member; 
    void LFC() 
    { 
	    cout<<"Its base class";
    };
};
class course:public team
{
    public : 
    void LFC()
    { 
      cout<<"Its derived class"; 
    }
};

int main() 
{ 
team t; course c;
t.LFC();
c.LFC();
} 

Its base classIts derived class
Its base class Its derived class
Its derived classIts base class
Its derived class Its base class

4. Can we have overloading of the function templates?

Yes
No
May Be
Can't Say

5. signed long int typical range equal to?

signed short int
unsigned short int
long int
double

6. State whether the following statements about inheritance are True or False. i) A public member of a class can be accessed by its own objects using the dot operator. ii) While inheriting, the private members of the base class will never become the members of its derived class.

True, False
False, True
True, True
False, False

7. What can be passed by non-type template parameters during compile time?

Int
Float
Constant expression
None of the above

8. Identify the incorrect statement?

Namespace is used to mark the beginning of the program
Namespace is used to mark the beginning & end of the program
A namespace is used to separate the class, objects
All of the above

9. What will be the output of this program?

#include <iostream>

using namespace std;

class LFC
{
    private:
        int x,y;
    public:
        void LFC(int a,int b)
        { x=a; y=b;}
};

int main()
{
    LFC s;
    return 0;
}

Compile Time Error
Run Time Error
No Error
Warning

10. Space taken by bitset bs is less than?

bool bs[N]
vector bs(N)
Both A and B
None of the above

Results