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;
}
1
Expert's answer
2014-01-13T14:36:58-0500
The answer to the question is available in the PDF file https://www.assignmentexpert.com/https://www.assignmentexpert.com/homework-answers/programming-answer-38105.pdf

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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS