InterviewSolution
Saved Bookmarks
| 1. |
test if a number is equal to the sum of the cubes of its digits, find the smallest and largest digit. Python program |
|
Answer» n3 program to largest and smallest digit of a NUMBER # FUNCTION to the largest and smallest digit of a number def Digits(n): largest = 0 smallest = 9 while (n): r = n % 10 # Find the largest digit largest = max(r, largest) # Find the smallest digit smallest = min(r, smallest) n = n // 10 print(largest,smallest) # Driver code n = 2346 # Function call Digits(n) i hope it is correcti had checcked it 3 timestyped by me comment if any mistakemark as brainliest |
|