Multiple choice

Identify the data member or the member variables in the above program.

class A
{
public: int a;
void display()
{
cout<<"Enter the value in a";
cin>>a;
}
};
void main()
{
A a1; a1.display();
getch();
}

  1. a1 is the data member of class A.

  2. a is the data member of class A.

  3. Display is the data member in class A.

  4. Both a and d together are data members in class A.

  5. None of these

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

In OOPS, the variables which we use in a class are known as data members.