Hi guys, first post here - excellent site so I thought I would ask for your help!
I've been following Bucky Roberts C++ programming tutorials on youtube, I seem to be coming along ok in theory and thought I should attempt to write some actual code.
I found some beginner exercises http://www.cplusplus.com/forum/articles/12974 <- here, and attempted the first one.
And this works, it does exactly what is asked of it in the exercise.
However being the ever seeking perfectionist that I am, I'm not happy in the fact that I'm sure there must be a more efficient way of doing things other than just repeating an if statement countless times.
Any way to improve on this attempt?
Many thanks,
Matt
Instead of repeating if, use else if. if must appear before an else if block. The last being else (optional). An if statement must be defined before using an else statement. For example: