i tried like you said

it doesnt work as before

Code:

#include <stdio.h>
int main (void) {
int i, j, c,l = 0;
int digit, result = 0;
printf( "\nEnter the number to flip: ");
scanf( "%d", &i);
digit=0;
result=0;
while (i != 0) {
digit = i % 10;
result = result * 10 + digit;
i /= 10;
}
l=result;
while (i != l) {
digit=0;
result=0;
while (i != 0) {
digit = i % 10;
result = result * 10 + digit;
i /= 10;
}
j = result;
printf( "%d + %d = %d\n", i, j, i+j);
c++;
i += j;
}
printf( "Completed in %d steps.\n", c);
return 0;
}