Time conversion

This is a discussion on Time conversion within the C Programming forums, part of the General Programming Boards category; can anybody helps me, please? Write a program to convert from 12-hour time format to 24-hour time format. The 12- ...

  1. #1
    Registered User
    Join Date
    Jan 2011
    Posts
    1

    Time conversion

    can anybody helps me, please?
    Write a program to convert from 12-hour time format to 24-hour time format. The 12-
    hour format has the form hours:minutes followed by either A, P, AM, or PM (either lower
    case or upper case but not mixed). One white space is allowed but not required between
    the numerical time and the AM/PM indicator. The 24-hour format must be printed with
    leading zeros, to ensure that a 24-hour time always consists of four digits. The output
    line is followed by a new-line character.

  2. #2
    Registered User
    Join Date
    Nov 2010
    Location
    Long Beach, CA
    Posts
    5,444
    Here's a tip to get you started: read the homework policy.

    Then, make a decent effort to do this on your own. If you still have problems, come back, post your code (in code tags) and ask specific questions.

  3. #3
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,439
    Cross-posted here as well (broadcast homework - yummy)
    programming a program? - C

    How To Ask Questions The Smart Way
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Partition and scheduling HW/SW help!
    By thangdc01_02 in forum C++ Programming
    Replies: 3
    Last Post: 11-18-2010, 01:07 PM
  2. Help fixing a compile time error
    By matt_570 in forum C Programming
    Replies: 2
    Last Post: 09-05-2009, 09:36 PM
  3. military time to integer conversion
    By arceeflores in forum C Programming
    Replies: 6
    Last Post: 08-12-2009, 08:03 AM
  4. Read and set\change system time
    By Hexxx in forum C++ Programming
    Replies: 9
    Last Post: 01-02-2006, 06:11 AM
  5. time class
    By Unregistered in forum C++ Programming
    Replies: 1
    Last Post: 12-11-2001, 09:12 PM

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