Browse Source

case exponent

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

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

@ -23,7 +23,7 @@ int main() {
displayMenu();
printf("Enter your choice: ");
scanf("%d", &choice);
switch (choice) {
switch (choice) {
case 1:
printf("Enter two numbers: ");
scanf("%d %d", &num1, &num2);
@ -52,7 +52,13 @@ switch (choice) {
printf("Result: %d\n", result);
}
break;
case 5:
case 5:
printf("Enter base and exponent: ");
scanf("%lf %lf", &num1, &num2);
result = exponent(num1, num2);
printf("Result: %lf\n", result);
break;
case :
printf("Exiting...\n");
break;
default:

Loading…
Cancel
Save