wap that to find the ASCII value of each character of string given by user .

 


#include <stdio.h>
#include <conio.h>
 
int main()
{
    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 :
Enter any string to get ASCII Value of each Character rahul ASCII values of each characters of given string: 114 97 104 117 108

Comments