Sail E0 Webinar
Question


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
Options:
A .  Enter an integer 5 Variable entered is 5
B .  runtime error
C .  error
D .  none of the mentioned
Answer: Option C

While using private member, you cant access it variable.



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers