4.2) Making Decisions
I will introduce if statements
with a series of examples that introduce more and more about the decisions and testing.
Say you have read in two variables, a
and b
, and you want to test to find out if a
is larger than b
. If it is true then you want to print a statement stating this result and if it is false then you want to print a statement suggesting to increase the variable a
.
Click to the next page to see an example of how to do this.