#include<stdio.h>
void main()
{
char ch;
printf("Enter a character: ");
scanf("%c", &ch);
printf("ASCII value of %c is %d", ch,(int)ch); // using type casting to convert char to int
}
void main()
{
char ch;
printf("Enter a character: ");
scanf("%c", &ch);
printf("ASCII value of %c is %d", ch,(int)ch); // using type casting to convert char to int
}
Comments
Post a Comment