31.4k views
3 votes
Write an algorithm to find out whether a number entered is divisible by 5​

1 Answer

1 vote

Step-by-step explanation:

Logic to check divisibility of a number

Input a number from user. ...

To check divisibility with 5, check if(num % 5 == 0) then num is divisible by 5.

To check divisibility with 11, check if(num % 11 == 0) then num is divisible by 11.

Now combine the above two conditions using logical AND operator && .

User Zuboje
by
6.0k points