Friday, June 27, 2008

//Sum of number as 45 means 9
#include
#include
void main()
{
clrscr();
int a,b,c=0;
cout<<"enter the number: ";
cin>>a;
while(a>0)
{
b=a%10;
c+=b;
a/=10;
}
cout<<"The Result is : "<getch();
}

No comments: