Set breakpoints at the first if statement and at the return statement. In Microsoft Visual C++ you also use the right mouse button but the item on the menu is "Enable/Disable Breakpoint". The resulting screen should look like:
The symbol in the margin is supposed to be the outline of a stop sign and indicates that the program will stop at that point.
Build your project. In Microsoft there is a special command to run in debug mode in the menu or you can pick to icon to the right of the exclamation point (!) -- it looks like a page with an arrow pointing down along the side of it.
When you run your program input 1, 2, and 3 as the three values. The program should stop and go back to the window with your source code and the line with the first if statement on it should be highlighted. This is due to the breakpoint. The statement has not yet been executed.
There is a step over button in the debuggers. It is a set of parenthesis or braces with an arrow going over both of them. You can use the F10 key to do the same thing if you can't find the button in integrated development environment. Use this to step ahead one statement. If you use the Debug -> run off of the menu you will go until the program finishes or you hit another breakpoint. To continue you should use the page with the arrow in Microsoft. Hopefully, you have stopped at the "return EXIT_SUCCESS;" statement and be able to bring the run window back to the front to examine the results.
Compile the program. There will be some warnings but should be no errors. When you run the program under Microsoft Visual C++ you will notice that it doesn't wait for any input, outputs an average of -1, and exits. This is due to the fact that when we reach the top of the while loop value has not been initialized (could have been a warning when you compiled it). When a variable is not initialized it may be any value. In the case of Microsoft it is evidently a negative value.