Computer Science, asked by aranmossis, 3 months ago

Write a program to enter a number and print smallest digit of given number.​

Answers

Answered by ajaykumarnilu
1

Answer:

  1. Take a number n as the input. An integer function smallest_digit(int n) takes 'n' as the input and returns the smallest digit in the given number. Now initialize min as the last digit of the given number. Iterate through the number and check if the number extracted is less than the minimum number.
Similar questions