Computer Science, asked by arnav3556, 10 months ago

write an algorithm to check whether the given number is divisible by 2 or not​

Answers

Answered by jidnyasa56
32

Explanation:

  1. Start
  2. Input n, 2
  3. Calculate if (n%2==0) then is divisible else not divisible
  4. Output number is divisible or not
  5. Stop
Answered by StaceeLichtenstein
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