Page 64 - Touchcode_C6_Flipbook
P. 64
Explanation:
The value of Number is 10, which is divisible by 2, so the first 'if' block will get executed
and after entering the else block inside the first if statement, the output will be 'green'
colour.
Step 15: Change the 'Number' to '15', in 'set Number' block, and click on 'Start the
simulator' block, the output will be:
Explanation:
You have enter the Number 15, which is not divisible by 2, so the control goes to nested
'if-else' block; and the number is divisible by 3 only, so the first if block will be skipped
and the else block will be executed, so the output will be 'red' colour.
Coding fact
In 1971, Bob thomas created the first self replicating computer program. It was named
CREEPER.
Coding uiz 03
Critical Thinking
Give one-word answer to the following questions.
a. Which logical operator is used to check if either one of two
or more conditions is TRUE? ..................................
b. Which logical operator is used to reverse or negate a condition? ..................................
62 Touchcode-VI

