Need help with a tiny program
I am trying to make a simple program, that receives two values from the user, and then prints a comment concerning the difference between these two values.
I was thinking something like this:
To add more dimension, I was thinking that the program would react if the difference was very big between the two variables.
Please input name 1: ok
Please input name 2: sure
Enter the value of ok: 3
Enter the value of sure: 5
sure is larger than ok, by 2.
Any idea or tips how to achieve this? I reason that a couple of 'if' would do the trick, but is there any other way that you could think of?
Please input name 1: first
Please input name 2: second
Enter the value of first: 500
Enter the value of second: 3
first is much larger than second, by 497
I am a beginner in C++, so if you would avoid too complicated solutions it would be greatly appreciated. I've read 300 pages in Stephen Prata's third edition though, so I'm not completely ignorant, but more advanced things I have no knowledge of.
Thanks in advance