|
@ -6,7 +6,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int add(int a, int b) { |
|
|
int add(int a, int b) { |
|
|
return a+b; |
|
|
|
|
|
|
|
|
return a + b; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
int minus (int a, int b){ |
|
|
int minus (int a, int b){ |
|
@ -47,4 +47,20 @@ int mode(int userChoice){ |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// display the mode options: |
|
|
|
|
|
|
|
|
|
|
|
int displayMenu(){ |
|
|
|
|
|
|
|
|
|
|
|
printf("\nCalculator Modes: \n"); |
|
|
|
|
|
printf("\n1: Basic Mode\n"); |
|
|
|
|
|
printf("\n2: Scientific Mode (Trigonomertic functions, Logarithm and exponential functions.)\n"); |
|
|
|
|
|
printf("\n3: Graph Mode (Draw and visualize functions.)\n"); |
|
|
|
|
|
printf("\n4: Programming Mode (Binary , octal and hexadecimal )\n"); |
|
|
|
|
|
printf("\n5: Unit converter Mode (length, weight volume etc.)\n"); |
|
|
|
|
|
printf("\n0: Exit calculator\n"); |
|
|
|
|
|
|
|
|
|
|
|
return 1; // return 1 to check if the function works |
|
|
} |
|
|
} |