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');