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?

//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!

Free Graphics Programs Online

The tools used in graphic design can be a costly investment, particularly if the user is not working as a professional in the field of digital arts. There are many individuals (MORE)

User Reviews for the Clean Program

One of the newest diet crazes is the Clean Program created by Dr. Alejandro Junger. This restorative detox diet lasts 21 days and consists of two meals of "Clean" shakes, one (MORE)

XML Files: What Are They and How to Open Them

If you find a strange file with the extension ".xml" on your computer, your first thought may be to suspect a virus or other malicious program. However, there are countless fi (MORE)

Write a c program to accept alist of 10 namews input by user then display the sorted list of names back to the user?

Hello, since you seem to be needing help with your homework, I can give you some psuedo code to help you on your way! [CODE] DECLARE ARRAY names[10] FOR i = 0 TO 9 names[i] (MORE)

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)

A Directory List for Programs

One of the most important pieces of information that you need to provide during the installation of any program is the directory in which this program will be installed. Witho (MORE)

The Various Directories Programs are Installed In

One of the most important pieces of information that you need to provide during the installation of any program is the directory in which this program will be installed. Witho (MORE)