FIND THE ASCII VALUE OF A GIVEN NUMBER
Find ASCII Value of a Given Number in C
#include <stdio.h>
#include <ctype.h>
#include<conio.h>
int main(void)
{
int number, result;
clrscr();
textcolor(2);
cprintf("ENTER ANY NUMBER = ");
number = getch();
printf("%c",number);
result = toascii(number);
printf("\n\nASCII VALUE OF %c IS %d\n", number, result);
getch();
return 0;
}
Output
No comments:
Post a Comment