[Solved] Exit when press 0 in C [duplicate]
[ad_1] Exapmple One of the ways. #include <stdio.h> #include <stdlib.h> void end_proc(void){ printf(“Quitting the program…\n\n”); exit(0); } void input_error_proc(void){ int ch; printf(“ERROR\n”); while((ch = getchar()) != ‘\n’ && ch != EOF);//clear input } int main(void){ int program; while(1){ printf(“\n” “Choose one of the following programs: \n\n” ” (1) Fibonacci Sequence Calculator \n” ” (2) Decimal … Read more