Can someone give me any alogrithims that show all functions in a calculator
#include <iostream>
double calc(double a, char op, double b)
{
switch(op) {
case '+':
return a + b;
case '-':
return a - b;
case '*':
return a * b;
case '/':
return a / b;
default:
throw error('operator not implemented');
}
}
int main() {}
Comments
Leave a comment