Browse Source

kabrel

remotes/origin/develop
fdai7801 11 months ago
parent
commit
1ea5d7ab65
  1. 34
      src/main/c/BasicMode.c

34
src/main/c/BasicMode.c

@ -71,6 +71,40 @@ int main() {
do { 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):"); 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); 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'); } while (auswahl1 != 'Q' && auswahl1 != 'q');

Loading…
Cancel
Save