Think,an int a=2348;
so the desired output should be 3458…
I tried to print out the last digit by this logic
int lastdigit(a){
int m=0;
for(int k=0;k<=9;k++)
{
m=a-k;
if(m%10==0)
return k;
}
return 0;
}
But i couldn’t use this idea successfully to get the upper limit digits…
Thanks.