Reply embedded...
> -----Original Message-----
> From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of
> Eliacem Galon
> Sent: Thursday, August 17, 2006 1:00 AM
> To: [email protected]
> Subject: Re: [c-prog] RE: Telephone Bill (need some help!!!!) C
> programming
>
> thanks for the rply.it was my cousin who send that it
> many times coz they felt confuse that my msg was sent.
> so she decided for the one or twice. im confusing
> that: when i'm using 24 hrs format, sample of this
> when the person call at 1259-1305. the answer is 6
> minutes and then when the computer calculate the
> answer is 46.
That explains my phone bill ;-)
> why this happened?
You made a mistake somewhere. If you truly want to learn, show your code so
that someone will point out your mistake. Learn from own mistakes and
understand the reasons is the best way to learn, IMHO.
I believe this is what you can do: convert hh:mm to minutes before computing
the difference in minutes:
13:05 = 13 * 60 + 05 = 785 min
12:59 = 12 * 60 + 59 = 779 min
The difference is 6 minutes.
This should work as long as both times are within the 24 hour period. You
have to take special care when the clock passes midnight.
> then i should round
> the remaining seconds to mins..
In that case, you might want to consider converting hh:mm:ss to seconds
first, than computing the difference in seconds, and finally round the
results to minutes.
Similarly you have to take special care when the two times cross midnight.
HTH
Shyan
To unsubscribe, send a blank message to <mailto:[EMAIL PROTECTED]>.
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/c-prog/
<*> 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/