C program which reads your name from the keyboard and outputs a list of ASCII codes which represent your name

Program

#include<stdio.h>
#include<conio.h>

void main()
{
int i;
char name[50];
clrscr();
printf(“Enter your name: “);
gets(name);
printf(“nCharactertASCII Code“);

for(i=0;name[i]!=”;i++)
printf(“n%ctt%d”,name[i],name[i]);

getch();
}

Output

Enter your name: the yor
Character    ASCII Code
t              116
h              104
r              101
y              121
o              111
r              114

Leave a Comment

error: Alert: Content is protected!!