i goot this code but one of u plz modify print only
at last
#include<stdio.h.
main()
{
int num=123,sum=0;
for(;num;sum+=num%10,num/=10,printf("\nSUM=%d",sum));
}
--- surya battina <[EMAIL PROTECTED]> wrote:
> hi
>
> u r mistaken my question.now i will
> explain u clearly.
> if a number s=12345678933
> then i have to count
> 1+2+3+4+5+6+7+8+9+3+3
>
> and this should be done in a sigle
> statement if u sue for loop there is 3 statements u
> have so it is not worked.
>
>
>
>
> 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]
>
>
>
>
> Yahoo! Groups SponsorADVERTISEMENT
>
>
> ---------------------------------
> Yahoo! Groups Links
>
> To visit your group on the web, go to:
> http://groups.yahoo.com/group/Programmers-Town/
>
> To unsubscribe from this group, send an email to:
> [EMAIL PROTECTED]
>
> Your use of Yahoo! Groups is subject to the
> Yahoo! Terms of Service.
>
>
>
> ---------------------------------
> Do you Yahoo!?
> Meet the all-new My Yahoo! � Try it today!
________________________________________________________________________
Yahoo! India Matrimony: Find your life partner online
Go to: http://yahoo.shaadi.com/india-matrimony
------------------------ Yahoo! Groups Sponsor --------------------~-->
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/EbFolB/TM
--------------------------------------------------------------------~->
To unsubscribe : [EMAIL PROTECTED]
Yahoo! Groups Links
<*> To reply to this message, go to:
http://groups.yahoo.com/group/Programmers-Town/post?act=reply&messageNum=4954
Please do not reply to this message via email. More information here:
http://help.yahoo.com/help/us/groups/messages/messages-23.html
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/Programmers-Town/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/