76 297
Assignments Done
Successfully Done
In May 2019

Answer to Question #38105 in C++ for yazan hussein

Question #38105
how can i add maximum numbers to calculate ?
and i have problem in % .. how can i make "enter the second number " disappear in % operation ? :v
this is my cal :

#include <iostream>
#include <math.h>
using namespace std;

int main()
double num, den, result;
char op;
do {
cout <<"\nCalculator - Enter Number: ";
cin >> num;
cout << "Enter operator : +,-,*,/,^,% : ";
cin >> op;
cout << "enter second number: " ;
cin >> den;
if (op=='+') result=num+den;
if (op=='-') result=num-den;
if (op=='*') result=num*den;
if (op=='/') result=num/den;
if (op=='^') result=pow(num,den);
if (op=='%') result=num/100;

cout << result;

while (op!='e') ;
return 0;
Expert's answer

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions