display ASCII value of given number :

CODE:



#include<stdio.h>
#include<conio.h>
void main ()
{
int n;
clrscr();
printf("Enter a number:");
scanf("%d",&n);
printf("The ASCII value of %d is: %c",n,(char)n);
getch();
}

OUTPUT :
Enter a number :65
The ASCII value of 65 is A

No comments :

Post a Comment