Friday, 13 April 2012

C++ program to print decimal value of Keys appear in Keyboard


//Print decimal value of buttons appear in keyboard

#include<iostream.h> 



using namespace std;

 int main()
 { 
       int a; 
       char b; 
         for(a=0;a<=255;a++)
            { 
               b=(char)a;
               cout<<"\nASCII value of character=> "<<b<<" "<<a;
            } 
     return 0; 
}
/*:-output wiil be like:-
ASCII value of character   : 32
ASCII value of character '!' : 33 
ASCII value of character' " '   : 34 
ASCII value of character '#'  : 35 
ASCII value of character '$'  : 36 
ASCII value of character '%'  : 37 
*/


No comments:

Post a Comment

Compiler for C,C++ and Python {paste your programme to see the output}