#include<stdio.h>
void ascii(char []);
void main()
{
char text[20];
clrscr();
printf("\nEnter a string :\n");
gets(text);
ascii(text);
getch();
}
void ascii(char txt[])
{
int a,len;
len=strlen(txt);
for(a=0;a<len;a++)
printf("\nASCII equivalent of %c : %d",txt[a],txt[a]);
}
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.