From 1ea5d7ab6570e8dd470b7e7b712541e3fa39049e Mon Sep 17 00:00:00 2001 From: fdai7801 Date: Fri, 9 Feb 2024 21:11:01 +0000 Subject: [PATCH] kabrel --- src/main/c/BasicMode.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/main/c/BasicMode.c b/src/main/c/BasicMode.c index a9e60fc..a338063 100644 --- a/src/main/c/BasicMode.c +++ b/src/main/c/BasicMode.c @@ -71,6 +71,40 @@ int main() { do { printf("what do you want to do?(A for conversion from decimal base to binary base ,B for conversion from binary base to decimal base ,C for Operation in binary base, Q for stop):"); scanf(" %c", &auswahl1); + switch (auswahl1) { + case 'A': + case 'a': + printf("Enter a decimal number: "); + scanf("%lld", &dec); + bin1 = DecToBin(dec); + printf("%lld in decimal = %lld in binary\n", dec, bin1); + break; + + case 'B': + case 'b': + printf("Enter a binary number: "); + scanf("%lld", &bin1); + dec = BinToDec(bin1); + printf("%lld in binary = %lld in decimalprintf\n"); + break; + + case 'C': + case 'c': + + + + + + + + break; + case 'Q': + case 'q': + printf("The programme is terminated.\n"); + break; + default: + printf("Invalid selection. Please enter again.\n"); + } } while (auswahl1 != 'Q' && auswahl1 != 'q');