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

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!

To display string in a title case in c?

include<stdio.h> #include<conio.h>#include<string.h>int main(){ int tmp,i; char str[30]; printf("Enter any string: "); gets(str); for(i=0; str[i]!='\\0'; i++ (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)

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)

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)

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)