C-programming - Display ascii values of characters, C program to display ascii values

Display ascii values of characters

This program prints the ascii values of the given input sting. Input can also be given in run time using for loop. This program user for loop and strlen function to find the length of the given word or statement.
#include<stdio.h>
#include <string.h>
int main()
{
int i;
char a[10]={"hello"};
printf("ascii values of entered string
");
for(i=0;i<strlen(a);i++)
printf("%d
",a[i]);
}
Output
ascii values of entered string
104
101
108
108
111
In real time this program can be used to find ASCII value of special characters and to troubleshoot the program.

The topic on C-programming - Display ascii values of characters is posted by - Math

Hope you have enjoyed, C-programming - Display ascii values of charactersThanks for your time

Tech Bluff