What would you like to do?

Write a C program to accept a string from user and display its ascii value and then display sum of all ascii value of strings?

already exists.

Would you like to merge this question into it?

already exists as an alternate of this question.

Would you like to make it the primary and merge this question into it?

exists and is an alternate of .

//C program to accept a string from user and
//display its ascii value and
//then display sum of all ascii value of strings

#include<stdio.h>
#include <string.h>

int main() {

char String[100];
int Sum,Index;
Sum=0; //Sum is initially zero

printf("Enter the string:\n");
gets(String); //Accept String from User

for(Index=0;Index<strlen(String);Index++)
{
Sum+=(String[Index]); //Adds (the ASCII values of) the String characters.
}

printf("The sum is %d\n",Sum); //Printing it as %d gives the equivalent ASCII value.

return 0;
}
4 people found this useful
Thanks for the feedback!

How to Make Nail and String Art

A simple way to add color and texture to your decor, with just a few supplies that you may already have on hand, you can create fun nail-and-string art. You can customize the (MORE)

Kid Crafts: How to Make Your Own String Doll

A string doll is an inexpensive way to make a small toy that you can dress however you like. After you have made your string doll, you can use felt or wrap the doll with addit (MORE)

What would you like to do?

Write a java application to accept a string display in following formet NOT to TON?

import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; class format {   public static void main(String args[])throws IOException {  (MORE)

What would you like to do?

Write overload functions in c plus plus to convert an ascii string to an int and to convert an ascii string to float?

Overloads cannot differ by return type alone. The only way to achieve this is to use output arguments. Since the implementation is exactly the same regardless of the output ty (MORE)

What would you like to do?

What is Kevin in ASCII values?

Determining the ASCII values for any string of characters is simple, requiring a for loop and an understanding of strings. All a string is in C is an array of characters ter (MORE)