16 lines
415 B
C
16 lines
415 B
C
#include <stdio.h>
|
|
|
|
void dualzahl_einlesen(char *buffer, int maxlen) {
|
|
printf("Geben Sie eine Dualzahl ein: ");
|
|
if (fgets(buffer, maxlen, stdin) == NULL) {
|
|
buffer[0] = '\0';
|
|
return;
|
|
}
|
|
// Zeilenumbruch entfernen
|
|
for (int i = 0; buffer[i]; ++i)
|
|
if (buffer[i] == '\n') buffer[i] = '\0';
|
|
}
|
|
|
|
void dualzahl_ausgeben(const char *buffer) {
|
|
printf("Ergebnis: %s\n", buffer);
|
|
} |