Skip to content

Instantly share code, notes, and snippets.

@smichaelsen
Created August 21, 2022 05:19
Show Gist options
  • Save smichaelsen/a2864124186747699cbf032ec87c1716 to your computer and use it in GitHub Desktop.
Save smichaelsen/a2864124186747699cbf032ec87c1716 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main() {
if(showMenu() == 0) {
printf("Telefonnummern: ");
} else {
printf("Neue Nummer hinzufuegen: ");
}
return 0;
}
int showMenu() {
int selection;
printf("#### Herzlich Willkommen ####\n");
printf("(0) Telefonnummern Anzeigen: \n");
printf("(1) Neue Nummer hinzufuegen: \n");
scanf(" %d", &selection);
printf("\n\n");
if(selection == 0 || selection == 1 ){
return selection;
} else{
printf("Eingabe ungültig!\n");
return selection;}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment