Answer to Question #322623 in Python for lokesh

Question #322623

Multiple of 5 :


(1) Input: 6 Output: 1

1 2

2 3

3

5

9

6


(2) Input: 5 Output: 1

1 2

2 3

3 4

4

5


1
Expert's answer
2022-04-03T08:00:00-0400
def isMultipleof5(n):
     
    while ( n > 0 ):
        n = n - 5
 
    if ( n == 0 ):
        return 1
 
    return 0
     
i = 19
if ( isMultipleof5(i) == 1 ):
    print (i, "is multiple of 5")
else:
    print (i, "is not a multiple of 5")

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS