Penekanan Tombol

Posted by Budi Arieyanto | Posted in | Posted on 02.59

#include <iostream.h>
#include <conio.h>
#include <ctype.h>

void main()
{
 char pil;
 cout<<"Pilihan Anda(A,B,Q):";
 pil=getch();
 pil=toupper(pil);

 while( ((pil=='A')||(pil=='B')||(pil=='Q')) )
 {
   pil= getch();
   pil= toupper(pil);
  }
   cout<<pil<<endl;

 getch();
}

Comments (0)

Posting Komentar