Thursday, December 13, 2012

write a program in c++ using class


#include<iostream.h>
#include<conio.h>
class Demo
{
int num1,num2;
public:
void get()
{
cout<<"Enter the two no\n";
cin>>num1>>num2;
}
void set()
{
cout<<"The value of num1 and num2 is="<<num1<<"and"<<num2;
}
};
void main()
{
clrscr();
Demo obj;
obj.get();
obj.set();

getch();



}


Output