0
A program that does the calculator using functions and uses any number specified by the user but at zero stops
for example 1+2+3...or 1Ă2Ă3... answer about my question please?
3 Answers
+ 2
Post up your code and what errors you're getting; I'll be more than happy to help you figure out what you're doing wrong.
+ 1
You answered your own question. Set up some functions for your math, set up means to obtain input from user / use checks to test your conditions, if zero then stop program.
0
void addi(int a,int b)
{
cout<<a+b;
}
void mult (int a,int b)
{
cout<<a*b;
}
void subt(int a,int b)
{
cout<<a-b;
}
void divi (int a,int b)
{
cout<<a/b;
}
int main()
{
int x,y;
char z;
cout<<"enter your option ";
cinn>>z;
cout<<"enter your number";
cin>>x;
cin>>y;
if (z=='+')
addi (x,y);
else if(z=='*')
mult (x,y);
else if (z=='/')
divi (x,y);
else if (z=='-')
subt (x,y);
return 0;
}
without an introduction