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 Java program to get the char value of the given ASCII?

import java.io.BufferedReader; class GetAsciiValue { public static void main(String arg[]) { InputStreamReader isr=new InputStreamReader(System.in); BufferedReader br= new

Write a program to accept two string and display weather they are identical or not?

I assume the program should be case-sensitive. Here is a code of such program: . include #include int main() { char str1[100]; char str2[100]; printf("Please e

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

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

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