design and algarithm and flowchart to find the given odd or even
what is the answer
Answers
Answered by
0
Answer:
The first step in the algorithm is taking a number as an input from User. Let's say user enters value 6. So 6 will be stored inside variable "number".
Now the next step in algorithm (i.e number%2==0), in this step (number%2) returns the remainder after dividing number by 2.
[Note: Here % is known as modulus, which is an operator that returns remainder value after division]
Now the next step (i.e. remainder==0) simply checks if the remainder value is equal to 0 or not.
So if the remainder is 0, then the number is said to be Even number else it is said to be an Odd Number.
If the User Inputs 6, then
number=6
Remainder=number%2
i.e Remainder=6%2
Remainder=0
As Remainder is 0, 6 is an Even Number
Answered by
0
even is correct answer. because odd and odd =even
Similar questions
Physics,
1 day ago
Math,
1 day ago
English,
1 day ago
Political Science,
8 months ago
English,
8 months ago