Re: help solving addition problem in C
- From: "@$|-|. DUBEY" <dubey.ashwini@xxxxxxxxx>
- Date: Mon, 13 Oct 2008 23:48:46 -0700 (PDT)
On Oct 14, 11:39 am, Pranav <pranav...@xxxxxxxxx> wrote:
On Oct 14, 11:30 am, "@$|-|. DUBEY" <dubey.ashw...@xxxxxxxxx> wrote:
i have a interger
val = 99999;
and i want to add the content of val i.e., 9+9+9+9+9 = 45;
how to do that....
need urgent help
take a temporary variable to store sum and initialize it to zero,
Now by recursively taking modulus and dividing the number you can each
digit separated and you can go on adding the digit..,
can u explain with code...
i didn't understand.....
.
- Follow-Ups:
- Re: help solving addition problem in C
- From: Nick Keighley
- Re: help solving addition problem in C
- References:
- help solving addition problem in C
- From: @$|-|. DUBEY
- Re: help solving addition problem in C
- From: Pranav
- help solving addition problem in C
- Prev by Date: Re: char*
- Next by Date: Re: [not quite ot] what language is this??
- Previous by thread: Re: help solving addition problem in C
- Next by thread: Re: help solving addition problem in C
- Index(es):
Relevant Pages
|