#include<stdio.h>
int main(void)
{
int num,res=0,minDigit,maxDigit;
printf("Enter a number\n");
scanf("%d",&num);
maxDigit=minDigit=num%10;
while(num)
{
res=num%10;
if(res<minDigit)
minDigit=res;
else if(res>maxDigit)
maxDigit=res;
num=num/10;
}
printf("Min Digit = %d\nMax Digit = %d\n",minDigit,maxDigit);
return 1;
}