Computer Science, asked by sairaj356, 9 months ago

. Read the given code and answer the following questions:

CLS

INPUT NUMBER

LET RESULT=NUMBER MOD 2

IF RESULT=0 THEN

LET NUMBER=NUMBER+1

PRINT NUMBER

ELSE

LET NUMBER=NUMBER+2

PRINT NUMBER

END IF

END

What will be the output if the value of variable “NUMBER” is

i) 20 ii)19

iii) What is the use of ‘mod’ operator in the given code?

iv) Explain the logic of the given code.

v) If division operator ‘/’ was used instead of the ‘mod’ operator, then what would be the output

of the given program? Assuming the user input is 10.​

Answers

Answered by jagirdaaraisha
5

Answer:

i) output is 21

ii) output is 21

iii) it gives the reminder value

v) output is 5

Explanation:

hope u understand the logic

Similar questions