#include <stdio.h>
#include <stdlib.h>
main()
{
char ch;
printf("press a key and then press enter:");
ch = getchar();
if(ch >= 'A' && ch <= 'z')
{
if(ch >= 'A' && ch <= 'Z')
{
ch = ch + 32 ;
printf("letter is %c, the ASCII is %d\n",ch,ch) ;
}
else if(ch >= 'a' && ch <= 'z')
{
ch = ch - 32 ;
printf("letter is %c, the ASCII is %d\n",ch,ch) ;
}
}
else
printf("letter is %c,the ASCII is %d\n",ch,ch);
}