getch() this is a function that would not terminate your program unless you press something on your keyboard....
if you'd like to use an automatic inputs i would suggest using getch(), for example:
Code:
int x=getch();
if (x==49) { cout<<"You Press number 1"; }
else { cout<<"Nothing has entered": }
the int x=getc() there will automatically get the value of x corresponds to your condition....
by the way in using this one.... if you enter number 1 into your keyboard.... in the computer 1 is equivalent to 49 , and 2 is 50.... for reference try this code and run it so that as you go along with your program you will not be wondering why does the number you entered doesn't corresponds to the computer:
Code:
#include<iostream>
#include<conio.h>
using namespace std;
main()
{
int x=getch();
cout<<x;
getch();
}