A good answer might be:
The false branch is executed because the answer to the questionEnter an integer: 12 The number 12 is positive Good-by for now num < 0 was false.
| |
The Program as a ChartHere is the program again, done as a flowchart. Because the answer to the question is "false", the false branch is done. The "two-way split" of the program is easy to see in a two dimensional chart. It is harder to see this in a program where line follows line one after another.
The flow chart shows the overall logic of the program. Most of the details of syntax are left out. It is often helpful to sketch a flowchart when you are designing a program. You can use the flowchart to get the logic correct, then fill in the details when you write the program. | |
QUESTION 4:The user runs the program and enters "-5". What will the program print? Click Here after you have answered the question |