ok i understand that i need to keep the num value.
I tried to do it here.Its not working.
Code:
#include <stdio.h>
int main(){
int count=0;
int num; //a number
int temp;
int f_num = 0; //flipped number
scanf("%d",&num);
do{
if ((num!=f_num)&&(count>0)){
num=num+f_num;
temp=num;
printf("num=%d f_num=%d temp=%d count=%d\n",num,f_num,temp,count);
}
temp=num;
while(num)
{
f_num = 10 *f_num + num % 10;
num /= 10;
}
count++;
printf("num=%d f_num=%d temp=%d count=%d\n",num,f_num,temp,count);
num=temp;
printf("num=%d f_num=%d temp=%d count=%d\n",num,f_num,temp,count);
}while (num!=f_num);
printf("%d",f_num);
return 0;
}