Friday, June 27, 2008

//last number multiply by 10 as 15 is 50, 23 is 30
#include
#include
void main()
{
clrscr();
int a,b,c,i=1,j=0;
cout<<"Enter a Num: ";
cin>>a;
c=a;
while(c>0)
{
c/=10;
j++;
}
c=0;
while(a>0)
{
b=a%10;
i=1;
while(i {
b*=10;
i++;
}
j--;
c+=b;
a/=b;
}
cout<<"Maghloob: "<getch();
}

No comments: