#include<iostream>
using namespace std;
int main()
{
int num,a,b,c,d,e,f,sum;
cout<<"Please enter a 4 digit number :";
cin>>num;
a=num%10;
b=num/10;
c=b%10;
d=b/10;
e=d%10;
f=d/10;
sum=a+c+e+f;
cout<<"The sum of the digits is "<<sum;
}
thanks alot (y)
ReplyDelete