- Convert string to ascii c programming.
- C program to find ascii value of a string or character.
- C program to print ascii value of alphabets.
- Now we will write a C program to print ASCII value of each character of a String.
Program #1: Write a C programming code to print ASCII value of String.
- #include <stdio.h>
- #include <stdlib.h>
- int main(int argc, char *argv[])
- {
- char str[100];
- int i=0;
- printf("Enter any string to get ASCII Value of each Character \n");
- scanf("%s",str);
- printf("ASCII values of each characters of given string:\n ");
- while(str[i])
- printf("%d \n",str[i++]);
- getch();
- }
Output:
No comments