SCHOOL OF CODE BUILDERS
Learn To CODE. Become A DEVELOPER.
Pages
HOME
DATA STRUCTURES
STRINGS
ARRAYS
MATRIX
BINARY TREES
LINKED LIST
STACK
QUEUE
SORTING
SEARCHING
C
PYTHON
PSEUDOCODE
CONTEST PROBLEMS
ALGORITHMS
PATTERNS
PHP
C PUZZLES
C INTERVIEW QUESTIONS
JAVA
C++
HASHING
RECURSION
BASIC C PROGRAMS
TCS-CODEVITA
FACEBOOK
CONTACT US
C program to find ascii value of a string
C program to find ascii value of a string
Output:
Enter a string to find its ascii value: abc
ASCII value of string abc is 294
Implementation:
#include
int main(void) { char s[1000]; int ascii=0; int i; printf("Enter a string to find its ascii value:\n"); scanf("%s",s); i=0; while(s[i]) { ascii += ((int) *(s+i)); i++; } printf("ASCII value of string %s is %d",s,ascii); return 0; }
PREVIOUS
NEXT
HOME