Question
1.
#include
2.
using namespace std;
3.
class sample
4.
{
5.
private:
6.
int var;
7.
public:
8.
void input()
9.
{
10.
cout
What is the output of this program?
1.
#include
2.
using namespace std;
3.
class sample
4.
{
5.
private:
6.
int var;
7.
public:
8.
void input()
9.
{
10.
cout
Answer: Option C
Was this answer helpful ?
While using private member, you cant access it variable.
Was this answer helpful ?
More Questions on This Topic :
Question 1.
Pick out the other definition of objects.
....
Question 6.
How to access the object in the class?
....
Question 7.
Where does the object is created?
....
Submit Solution