I dont believe it cuts off the first digit.
I dont believe it cuts off the first digit.
>It cuts off the first digit.
Hence the first printf call.
My best code is written with the delete key.
Doh, didn't see the mod on the first printf.
Ok it doesn't work because of neg numbers, yeah I can save this
Code:int n=12345,c=10,a=0; while(n%c!=n*10) { a=n%c; printf("%d",a / (c/10)); n-=a; c*=10; }
Last edited by megablue; 09-10-2004 at 06:08 AM.