Showing posts with label COnversion Between Objects. Show all posts
Showing posts with label COnversion Between Objects. Show all posts

Wednesday, 7 March 2012

Program Of Conversion Between Objects With C++


#include<iostream.h>
#include<conio.h>
class add
{
float a,b;
public:
void getdata(float x,float y)
{
   a=x;
   b=y;
}
{
 float c;
 c=int(a/b);
 cout<<"\n Answer="<<c;
}

};
main()
{
clrscr();
add a1;
float p,q,c;
cout<<"\n ENter First Value";
cin>>p;
cout<<"\n ENter Second Value";
cin>>q;
a1.display();
getch();
}