C program to find or print the ASCII value of every letter in a string or statement.
In this tutorial we will discuss that how to write a simple C program to find the ASCII value of every character in a string.
In this tutorial we will discuss that how to write a simple C program to find the ASCII value of every character in a string.
C program code
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
int i;
char str[100];
printf("\n ENTER A STRING OR SENTENCE TO FIND ASCII VALUES OF EVERY LETTER:\n ");
gets(str);
for(i=0;i<strlen(str);i++)
{
printf("\n ASCII VALUE OF %c IS -----> %d\n ",str[i],str[i]);
}
getch();
}
OUTPUT:
Please share this post and blog link with your friends.For more programs use this blog.
If you have any problem, please comment in comment box, subscribe this blog for notifications of new post on your email and follow this blog.If you have any method of this program or want to give any suggestion send email on hc78326@gmail.com
Created by-- HARSH CHAUHAN
No comments:
Post a Comment