The program is simple but conio.h is not standard library so the function getch() also is not standard. Remove the included library and instead of getch() use getchar().
The program is simple but conio.h is not standard library so the function getch() also is not standard. Remove the included library and instead of getch() use getchar().
Use the curses library:
http://www.apmaths.uwo.ca/~xli/ncurses.html