203 Flashcards
What is boolean?
This is a type of variable where it can only be true or false
How is an if statement executed?
If the conditional statement is true then the block of code will be executed.
What is the condition for a While loop to loop?
The statement must be true.
What is the condition for a for loop to loop?
As long as the statement is true.
What is a do while loop?
The contents of the loop is executed before the condition is quieried
What is the difference between a for loop and while loop?
A for loop has an initialisation part and an incrementor part that increments every time the loop loops
Why would you use a for loop instead of a while loop?
When the number of loops is known before hand