1.

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

Answer»

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.


Discussion

No Comment Found