Class definition including its members in C++

Class definition including its members

PROGRAM :-

#include<iostream.h>
class ABC
{
 
              private: int data;
             
              public: void getdata()
{

cout<<"Enter the number: ";
cin>>data;
cout<<""The number entered is:"<<data;

}
}
void main()
{

  ABC obj;
obj.getdata();

}

Output :-

Enter number: 10
The number entered is : 10

Comments

Popular posts from this blog

How to make a snake game using notepad using html [ with pictures ]

How to " Shut down " your pc using notepad [with pictures]

How to make" web html page " just using notepad [ with pictures ]