write aprogram to accept a number then find the smallest digit of the number . example 385 the smallest digit is 3. answer fast i will mark you brainliest do not spam i report you.
Answers
Answered by
0
Answer:
As you have not mentioned the programming language, I assume it is C.
Explanation:
#include<stdio.h>
int main ()
{
int num, reminder;
printf ("Enter the Number :");
scanf ("%d", &num);
int smallest=num%10;
while (num > 0)
{
reminder = num % 10;
if (smallest> remider)
{
smallest = reminder;
}
num = num / 10;
}
printf ("The Smallest Digit is :%d \n", smallest);
return 0;
}
Similar questions