C Program to display ASCII value of a Character, it's next character, and it's previous character.


 #include<stdio.h>  
 #include<conio.h>  
 main()  
 {  
         char c;  
         clrscr();  
         printf("Enter the character\n");  
         scanf("%c",&c);  
         printf("\n The ASCII value of %c is %d",c,c);  
         printf("\n Previous character of %c is %c",c,c-1);  
         printf("\n Next Character of %c is %c",c,c+1);  
 }   


OUTPUT :


Enter the character
s
The ASCII value of s is 115
Previous character of s is r
Next Character of s is t

Popular posts from this blog

Write a java program for a cricket player The program should accept the details from user (max 10): Player code, name, runs, innings- played and number of times not out.

Write a MultiThreading program in java using Runnable interface to draw temple flag on an applet container.

Create a smiling and crying face alternet using Threading Mechenism