//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();
}
//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();
}