0% found this document useful (0 votes)
23 views8 pages

Quiz-C

The document contains a 7 question C++ quiz about object oriented programming concepts like abstraction, accessing objects in classes, defining classes and functions, and required header files. Each question has multiple choice answers.

Uploaded by

salemlaksh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views8 pages

Quiz-C

The document contains a 7 question C++ quiz about object oriented programming concepts like abstraction, accessing objects in classes, defining classes and functions, and required header files. Each question has multiple choice answers.

Uploaded by

salemlaksh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 8

C++ Quiz

Question 1
Q. In Object Oriented programming, abstraction
refers to ?
• A. showing only the essential features of the
application and hiding the details.
• B. data binding.
• C. reuse once written code again and again
• D. features which allows to create functions with
same name
Question 2
2. How to access the object in the class?
a) scope resolution operator
b) ternary operator
c) direct member access operator
d) none of the mentioned
Question 3
int main( )
What is the output of the {
following program? Box Box1;
double volume;
#include <iostream> Box1.height = 5;
using namespace std; Box1.length = 6;
class Box Box1.breadth = 7.1;
{ volume = Box1.height *
public : Box1.length * Box1.breadth;
double length; cout << "Volume of Box1 : " <<
double breadth; volume <<endl;
double height; return 0;
}; }
a) 210
b) 213
c) 215
d) 217
Question 4
How many objects can present in a single class?
a) 1
b) 2
c) 3
d) as many as possible
Question 5
Why is a class useful in programming?

1. can closely model objects in the real world.


2. bring together all aspects of an entity in one
place.
3. permit data to be hidden from other classes.
4. are removed from memory when not in use.
Question 6
include<iostream>
using namespace std;
void f()
{
cout<<"Hello"<<endl;
}
main()
{
}

A - No output
B - Error, as the function is not called.
C - Error, as the function is defined without its declaration
D - Error, as the main() function is left empty
Question 7

• The header file that must be included while using


cout function in a C++ program is
– A. Conio.h
– B. Math.h
– C. Iostream.h
– D. None of the Above

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy