Programming 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 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.

I know you have to declare a char and an int variable but I am stuck after that.Should I read it from the keyboard and use Ascii values?

Thanks for the help!

1 Answer

  • EddieJ
    Lv 7
    3 weeks ago

    You shouldn't read it from the keyboard.  It tells you read from standard input.

Still have questions? Get your answers by asking now.