Ask Question
9 August, 22:44

Write a program that reads characters from the standard input to end-of-file. For each character, have the program report whether it is a letter. If it is a letter, also report its numerical location in the alphabet. For example, c and C would both be letter 3. Incorporate a function that takes a character as an argument and returns the numerical location if the character is a letter and that returns - 1 otherwise.

+1
Answers (1)
  1. 10 August, 00:54
    0
    From stack overflow

    in the C language:

    #include ctype. h

    int GetPosition (char c)

    {

    c = tolower (unsigned char (c));

    if (c > = 'a' && c < = 'z') return c - 'a';

    else return - 1;

    }
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Write a program that reads characters from the standard input to end-of-file. For each character, have the program report whether it is a ...” in 📘 Engineering if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers