COMPUTER SCIENCE AND ENGINEERING
ALGORITHMS
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
STARTINPUT number 1INPUT number 2 IF number1 > number 2 OUTPUT sterling5.00ELSEOUTPUT £10.00
|
The text above is a flow chart
|
|
The text above is pseudocode
|
|
If n1 > n2 the output is £5.00
|
|
If n2 > n1 the output is £10.00
|
|
If n2 > n1 the output is £5.00
|
Explanation:
Detailed explanation-1: -number % 2 == 0 is a valid boolean expression that checks whether number % 2 is equivalent to 0 . For even number s, the result is the value, True .
Detailed explanation-2: -A simple method for this is to simply take the log of the number on base 2 and if you get an integer then number is power of 2.
There is 1 question to complete.