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

Popular Post

Define a class to represent a Bank Account. Include the following members: Data Members: i. Name of the depositor ii. Account number iii. Type of account iv. Balance amount in the account Member Functions: 1. To Input initial values 2. To deposit an amount 3. To withdraw an amount after checking the balance 4. To display name and balance Also write constructor for this class that takes four arguments. It should also handle type of account as savings by default