I have been going through the book C++ primer and have decided to write about exercises that I found difficult. I will be explaining the solutions to these exercises in brief so that you can understand the logic behind the code. Also, this will be better than writing lengthy posts on a particular feature when there are already many such posts available.

Exercise 5.12: Modify our vowel-counting program so that it counts the number of occurrences of the following two-character sequence: ff, fl, and fi.

The question before this was about counting vowels from our input.

Solution: we can store the last character into a separate variable and then check for the user’s current input if the last input was f.

Obviously, all of this goes into your main function.


Weird Programmer

I hate people who use LOL in face to face conversations. Also, if I tell you anything else about myself, then I'll have to KILL you~~!

Leave a Reply

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  Subscribe  
Notify of
%d bloggers like this: