Hello
In the code bellow the user will enter 1 or 2 or 3 and it will be taken by getch and after that the program will enter to switch ....but i have a problem
after applying any case of switch i want to make the program back to the beginning if the user press any key ?
my English is not perfect and i the c language is still new for me so it will be great if you explain in simple way
Code:
#include<stdio.h>
#include<unistd.h>
#include<stdlib.h>
#include<math.h>
#include<conio.h>
int main(void) {
char L;
while (1){
L=getch();
switch (L) {
case '1' :
system("cls");
printf("111111111111111")
break;
case '2' :
system("cls");
printf("222222222222222" ) ;
;break;
case '3' :
system("cls");
printf("33333333");break;
default :
sleep(0);
}
}
}