C(4)

profilemagino8080

 Write a function that takes two parameters (a string of no more than 50 characters and a letter the user inputs), then returns the count of how many times user input character is in the string. If the letter is not found, the function returns -1. Example "Hello",' f' returns -1.
Use the function in main to get two inputs from the user, a sentence and a character, then show the count of that character. 

    • 7 years ago
    • 5
    Answer(1)

    Purchase the answer to view it

    blurred-text
    • attachment
      CharacterCount.zip