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

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

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

Write a program to accept two numbers and display their sum?

include #include #include void main() { clrscr(); int a,b,sum; printf("Enter first number "); scanf("%d",&a); printf("Enter second number "); scanf("%d",&b

Write a program to accept a character value from the user and sHow its ASCII value?

#include #include main() { clrscr(); int x; char y; printf("enter the number"); scanf("%d",&x); printf("enter the char"); scanf("%c",&y); if(sizeof(x)2)

How do you convert a string of characters into ASCII values in C language?

Basically what i need the code to do is to change a string of characters in to either uppercase or lowercase depending on wether or not the 3 input character is upper or lower

Write a program to print all ASCII?

for (int i = 0; i<=255; i++)   {   char x = i ;   cout << "Ascii value of " << i << ":: " << x << "\\n";   }

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

Write a program to accept a string from keyboard and count and display the numbers of vowels present in the string by using function?

You need to scan through the string and keep track of the vowels occurring.  Here is a sample program: #include#include int countVowels(char[] s){ int count = 0, i; for( i=0