Friendly Numbers A five-digit integer is said to be friendly if the leftmost digit is divisible by 1, the leftmost two digits are divisible by 2, the leftmost three digits are divisible by 3, the...


Friendly Numbers


A five-digit integer is said to be friendly if the leftmost digit is divisible by 1, the leftmost two digits are divisible by 2, the leftmost three digits are divisible by 3, the leftmost four digits are divisible by 4, and the leftmost five digits (the five-digit number itself) is divisible by 5. For example, the number 42325 is friendly because 4 is divisible by 1, 42 is divisible by 2, 423 is divisible by 3, 4232 is divisible by 4, and 42325 is divisible by 5. Write a program that prompts for a fi ve-digit integer and determines whether or not the number is “friendly.”

Nov 16, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here