Functions Assignment
Functions Assignment
QUESTION 1
Amend your calculator code to have individual functions handling its operation. These functions need to
be callable by the main() function and return their response to main.
#include <stdio.h>
if (num2 == 0) {
} else {
int main() {
char operator;
double num1, num2, result;
scanf("%c", &operator);
switch (operator) {
case '+':
break;
case '-':
break;
case '*':
break;
case '/':
break;
default:
printf("Invalid operator\n");
}
return 0;