# Write calculator program using functions

Solution:-
#include<iostream>
#include<conio.h>
using namespace std;
//Prototypre of sum
//Prototypre of subtraction
double sub(double,double);
//Prototypre of subtraction
double multi(double,double);
//Prototypre of Division
double divide(double,double);
int main()
{
double sum=0,subtract=0,multy=0,div=0,number1=0,number2=0;
cout<<"Please Select any on from below \n";
do
{
cout<<"2--Subtraction\n";
cout<<"3--Multiplication\n";
cout<<"4--Division\n";
cout<<"0--Close\n";
{
break;
}
cout<<"Enter the value of number 1 = ";
cin>>number1;
cout<<"Enter the value of number 2 = ";
cin>>number2;
{
cout<<"Sum is = "<<sum;
}
{
subtract=sub(number1,number2);
cout<<"Subtraction is = "<<subtract;
}
{
multy=multi(number1,number2);
cout<<"Multiplication is = "<<multy;
}
{
div=divide(number1,number2);
cout<<"Division is = "<<div;
}
}
getch();
}
// define of sum
{
double sum;
sum=no1+no2;
return sum;
}
// define of Subtraction
double sub(double no1,double no2)
{
double sub;
sub=no1-no2;
return sub;
}
// define of multiplication
double multi(double no1,double no2)
{
double multi;
multi=no1*no2;
return multi;
}
// define of Division
double divide(double no1,double no2)
{
double div;
div=no1/no2;
return div;
}