From c0d776bc4ea3c09ea4841045c72dc54c6d8b15c4 Mon Sep 17 00:00:00 2001 From: fdai7782 Date: Mon, 5 Feb 2024 18:09:57 +0000 Subject: [PATCH] Added functionality (not complete) in scientific.c and changed the file name to scientificMode.c --- src/main/c/scientificMode.c | 44 +++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 src/main/c/scientificMode.c diff --git a/src/main/c/scientificMode.c b/src/main/c/scientificMode.c new file mode 100644 index 0000000..52ba133 --- /dev/null +++ b/src/main/c/scientificMode.c @@ -0,0 +1,44 @@ +// scientificMode + +#include +#include +#include "taschenrechner.h" + + +int scientificMode(){ + + double num, result; + + int choice; + + printf("Enter a number: "); + + scanf("%lf", &num); // scan the number from user + + printf("Scientific mode Options:\n"); + printf("1: Square root:\n"); + printf("2: Exponential:\n"); + printf("2: Logarithm:\n"); + printf("4: Trigonomertic"); + scanf("%d", &choice); // user choice + + switch(choice) { + + case 1: // Square root + break; + + case 2: // Exponential + break; + + case 3: // Logarithm + break; + + case 4: // Trigonomertic + break; + + default: printf("Invalid choice. Please try again.\n"); + + } + + return result; +}