# 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;

}

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

## Comments

## Leave a comment