int ascii_value(char c);
void main()
{
int i,a;
char c;
clrscr();
printf("Please enter any string...");
printf("String will be terminated if you pressing Ctrl-Z.");
printf("Enter String: ");
for (i=0;(c=getchar())!=EOF;i++)
{
a=ascii_value(c);
printf("%d%c",a,' ');
}
printf("are the ascii values of the characters of the given string");
getch();
}
int ascii_value(char c)
{
int a;
a=(int)c;
return(a);
}
No comments:
Post a Comment