Tried posting earlier; think didnt wrk!! this one i hav replied frm my mailbox!!!
 
long num;
num=1123456789;
while(num && (sum+=num%10, num/=10));

zulqrnain alisial <[EMAIL PROTECTED]> wrote:
try this in C++ main()
int sum=0
for (int i=1;i<=10;i++)
{
sum+=i;
}
cout<<sum;


surya battina <[EMAIL PROTECTED]> wrote:
hi all
 
        can u give the idea to sum all digits of a 10 or more digited number using single statement.
 


Do you Yahoo!?
Jazz up your holiday email with celebrity designs. Learn more.

To unsubscribe : [EMAIL PROTECTED]





Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now

To unsubscribe : [EMAIL PROTECTED]





Do you Yahoo!?
Jazz up your holiday email with celebrity designs. Learn more.

To unsubscribe : [EMAIL PROTECTED]




Yahoo! Groups Sponsor
ADVERTISEMENT
click here


Yahoo! Groups Links

Reply via email to