#include<iostream.h>
#include<conio.h>
class twonum
{
private :
int x,y;
public:
void getvalues()
{
cout<<"enter any two numbers";
cin>>x>>y;
}
void putvalues()
{
cout<<"\n\n"<<x<<","<<y;
}
int add(int x,int y)
{
return(x+y);
}
int multiply(int x,int y)
{
return(x*y);
}
void swap(int x,int y)
{
int c;
c=x;
x=y;
y=c;
cout<<x<<","<<y;
};
void main()
{
clrscr();
int k,j,l;
twonum s;
s.getvalues();
s.putvalues();
k=s.add(x,y);
cout<<"addition:"<<k;
j=s.multiply(x,y);
cout<<"multiplication:"<<j;
s.swap(x,y);
getch();
}
TĦɇ Ãðît 0 Newbie Poster
rproffitt 2,662 "Nothing to see here." Moderator
AssertNull 1,094 Practically a Posting Shark
AssertNull 1,094 Practically a Posting Shark
rproffitt commented: You made good points as well. The code, well, it's just a code dump and run with many dangling unspoken questions. +11
tinstaafl 1,176 Posting Maven
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.