#include<iostream.h>
#include<conio.h>
class mahi
{
public :
int c;
void add(int a,int b)
{
c=a+b;
cout<<"\n"<<" "<<c;
}
void getname(char *s)
{
cout<<"\n"<<s;
}
};
void main()
{
clrscr();
mahi m1;
m1.getname(" Addition");
cout<<"\n";
m1.getname(" A + B");
cout<<"\n";
m1.add(10,20);
getch();
}
#include<conio.h>
class mahi
{
public :
int c;
void add(int a,int b)
{
c=a+b;
cout<<"\n"<<" "<<c;
}
void getname(char *s)
{
cout<<"\n"<<s;
}
};
void main()
{
clrscr();
mahi m1;
m1.getname(" Addition");
cout<<"\n";
m1.getname(" A + B");
cout<<"\n";
m1.add(10,20);
getch();
}
No comments:
Post a Comment