Ask Question
22 September, 12:48

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.

+2
Answers (1)
  1. 22 September, 15:01
    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?
Get 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 there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers