Browse Source

case 4a entry

remotes/origin/Ulrich
Ulriche Nguefack 11 months ago
parent
commit
135d7e7ab1
  1. 10
      src/main/c/Calculator/calculator.c

10
src/main/c/Calculator/calculator.c

@ -32,4 +32,14 @@ switch (choice) {
scanf("%d %d", &num1, &num2);
result = multiply(num1, num2);
printf("Result: %d\n", result);
break;
case 4:
printf("Enter two numbers: ");
scanf("%d %d", &num1, &num2);
if (num2 == 0) {
printf("Error: Division by zero\n");
} else {
result = divide(num1, num2);
printf("Result: %d\n", result);
}
break;
Loading…
Cancel
Save