Ask Question
13 June, 13:29

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. 13 June, 13:53
    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 the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers