Write a program to addition subtraction multiplication and division of two numbers using class
Answers
Answered by
5
#include<iostream.h>
#include<conio.h>
int res;
void main()
{
clrscr();
int sum(int,int);
int sub(int,int);
int mul(int,int);
int a,b,m,su,s;
cout<<“Enter two numbers:”;
cin>>a>>b;
s=sum(a,b);
su=sub(a,b);
m=mul(a,b);
cout<<“Sum:”<<s<<“nSubtraction:”<<su<<“nMultiplication:”<<m;
getch();
}
sum(int a,int b)
{
res=a+b;
return(res);
}
sub(int a,int b)
{
res=a-b;
return(res);
}
mul(int a,int b)
{
res=a*b;
return(res);
}
#include<conio.h>
int res;
void main()
{
clrscr();
int sum(int,int);
int sub(int,int);
int mul(int,int);
int a,b,m,su,s;
cout<<“Enter two numbers:”;
cin>>a>>b;
s=sum(a,b);
su=sub(a,b);
m=mul(a,b);
cout<<“Sum:”<<s<<“nSubtraction:”<<su<<“nMultiplication:”<<m;
getch();
}
sum(int a,int b)
{
res=a+b;
return(res);
}
sub(int a,int b)
{
res=a-b;
return(res);
}
mul(int a,int b)
{
res=a*b;
return(res);
}
Similar questions
English,
7 months ago
Math,
7 months ago
Physics,
7 months ago
Computer Science,
1 year ago
Computer Science,
1 year ago
English,
1 year ago
English,
1 year ago