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;
The answer to the question is available in the PDF file https://assignmentexpert.com/https://assignmentexpert.com/homework-answers/programming-answer-38105.pdf
Comments
Leave a comment