/* This is a magic number guessing game. You think of a number below 63, and then this game will tell you what your secret number is. ####################################################################### # (c) 2007 by Krishna Khanna Magic Number Guessing Game # krishnakhanna@gmail.com # http://kkonline.org ####################################################################### */ #include #include #include #include #include void main() { clrscr(); int n,x; char temp,cont; n=0; do{ clrscr(); gotoxy(20,1); cout<<"WELCOME TO MAGIC NUMBER GAME!!!"<>temp; x=temp; if (x==121 ||x==89) {n=n+1;} clrscr(); cout<>temp; x=temp; if (x==121 ||x==89) {n=n+2;} clrscr(); cout<>temp; x=temp; if (x==121 ||x==89) {n=n+4;} clrscr(); cout<>temp; x=temp; if (x==121 ||x==89) {n=n+8;} clrscr(); cout<>temp; x=temp; if (x==121 ||x==89) {n=n+16;} clrscr(); cout<>temp; x=temp; if (x==121 ||x==89) {n=n+32;} clrscr(); cout<<"\nThe number you chose is "<>cont; cont=tolower(cont); } while(cont=='y'); getch(); }