#include<iostream.h>
#include<conio.h>
void main()
{
                int n,num,sum,rem;
                clrscr();
                cout<<"Enter The Number :- ";
                cin>>n;
                cout<<endl<<n;
                do
                                {
                                num=n;
                                sum=0;
                                while(num>0)
                                                {
                                                rem=num%10;
                                                sum=sum+rem;
                                                num=num/10;
                                                }
                                n=n-sum;
                                cout<<" - - -> "<<n;
                                }while(n!=0);
                getch();
}

45

Advertisements