/* * To reverese the ASCII value of the character * Author: rahule@cse.iiitk.ac.in * * Created on 14 August, 2010, 1:41 AM */ #include /* * */ int main() { char a; int i,rev,d; rev=0; printf("Enter a character :"); scanf("%c",&a); i=a; printf("ASCII :%d\n",i); while(i) //loop for reversing { d=i%10; //takes the last digit of i rev=rev*10+d; //appendsd to rev i=i/10; //trims of the lst digit of i } printf("reversed ASCII :%d\n",rev); }