write an algorithm to check whether the given number is divisible by 2 or not
Answers
Answered by
32
Explanation:
- Start
- Input n, 2
- Calculate if (n%2==0) then is divisible else not divisible
- Output number is divisible or not
- Stop
Answered by
17
Following are the algorithm to check whether the given number is divisible by 2 or not
Explanation:
Step 1: Start the algorithm.
Step 2: Read the number by the user in variable "x".
Step 3:Test the condition if n mod(%) 2 equals 0 then move to Step 4 .otherwise Move to Step 5.
Step 4: Display " Number is divisible by 2 ".
Step 5: Display " Number is not divisible by 2 ".
Step 6: End the algorithm.
- In this, we used % to check the particular condition.
Learn More :
- https://brainly.in/question/6764888
Similar questions