Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void calc(float x, float y, char operation, float& result)
- {
- switch (operation)
- {
- case '+':
- result = x + y;
- return;
- case '-':
- result = x - y;
- return;
- case '*':
- result = x * y;
- return;
- case '/':
- VERIFICA SA NU FIE y == 0
- result = x / y;
- return;
- default:
- EROARE PE AICI
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement