C Board  

Go Back   C Board > General Programming Boards > C Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 11-17-2003, 07:03 AM   #1
Registered User
 
Join Date: Nov 2003
Posts: 5
sutracting 24 hour time

I need to construct a ‘C’ program that subtracts one time from another. The times are expressed in terms of a number of hours and a number of minutes and are in 24-hour format. For example, subtracting 1 hour 30 minutes from 1 hour 0 minutes (representing 01:00) should result in 23:30 being displayed (i.e. 11:30pm the previous day). The user will enter four values (the hours and minutes of each of the two times) and the program should then output the result of the subtraction in 24-hour format.

Any help will be much appreciated
davidmccabe is offline   Reply With Quote
Old 11-17-2003, 07:10 AM   #2
+++ OK NO CARRIER
 
quzah's Avatar
 
Join Date: Oct 2001
Posts: 10,640
No one is going to do your homework for you. Post your attempt and what you're having problems with. While you're at it, read the forum rules at the top of the forum.

Quzah.
__________________
Hundreds of thousands of dipshits can't be wrong.


Are you up for the suck?
quzah is offline   Reply With Quote
Old 11-17-2003, 07:13 AM   #3
Registered User
 
Join Date: Nov 2003
Posts: 5
would i need to change all times into minutes first and work from there or will i keep them in hours. also would i need to use floor
davidmccabe is offline   Reply With Quote
Old 11-17-2003, 07:45 AM   #4
and the hat of Jobseeking
 
Salem's Avatar
 
Join Date: Aug 2001
Location: The edge of the known universe
Posts: 21,680
> would i need to change all times into minutes first and work from there or will i keep them in hours
Either will work, though I suspect one will be easier than the other.

But as you said, "I need to construct a ‘C’ program"
You DO
We advise, suggest, correct, hint, explain
__________________
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.

Salem is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Execution Time - Rijandael encryption gamer4life687 C++ Programming 5 09-20-2008 09:25 PM
Time to seconds program Sure C Programming 1 06-13-2005 08:08 PM
Killing someones grandparents nickname_changed A Brief History of Cprogramming.com 37 09-07-2003 07:56 AM
The Timing is incorret Drew C++ Programming 5 08-28-2003 04:57 PM
relating date.... Prakash C Programming 3 09-19-2001 09:08 AM


All times are GMT -6. The time now is 02:06 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22