hstring.c ========= #include #include #define MAXSTRING 100 main() { char c, name[MAXSTRING]; int i, sum = 0; printf("\nHi! What is your name? "); for (i = 0; (c = getchar()) != '\n'; ++i) { name[i] = c; if (isalpha(c)) sum += c; } name[i] = '\0'; printf("\n%s%s%s\n%s", "Nice to meet you ", name, ".", "Your name spelled backward is "); for (--i; i >= 0; --i) putchar(name[i]); printf("\n%s%d%s\n\n%s\n", "and the letters in your name sum to ", sum, ".", "Have a nice day!"); } Output: Hi! What is your name? John B. Doe Nice to meet you John B. Doe. Your name spelled backward is eoD .B nhoJ and the letters in your name sum to 745. Have a nice day!