Friday, December 11, 2015

Identify Key Press using C program


Program #19


Description:
Identify Key Press using C program

int main(){
 char c=' ';
 clrscr();
 printf("\nPlease press a SPACE Bar to EXIT:\n");
 for(;!kbhit();){
    c = getch();
    if (c == ' '){
      return 0;
    } else {
      printf("%c:%d\t",c,c);
    }
 }
 getch();
 return 0;
}


 

No comments:

Post a Comment

Popular Posts