also @ TechSpot: Facebook headhunts Apple engineers for 3rd smartphone attempt

TechSpot

C program

Discussion in 'Software Apps' started by katmandu, Feb 19, 2006.

Thread Status:
Not open for further replies.
  1. katmandu Newcomer, in training

    Hello brothers, hey could anybody pleaser help me out. I need to write a program in C language that converts time from 24 hours notation to 12 hour notation, and Im sort of lost, Id appreciate from the heart your help.

    This is what I should get, for instace, inputa time as two integers: 14 25
    anf my outpu should be: that is 2 25 in 12 hour notation.

    Please help.
  2. katmandu Newcomer, in training

    thanks

    Nodsu, I appreciate it, that should be enough.

    God bless,

    Katmandu :hotouch:
  3. Nodsu Newcomer, in training

    Schoolwork, eh?

    Not going to write the whole program.. This is the beef that actually does the "conversion". If you don't understand what this is or does, then you need to read up on basics of C..

    Code:
    int toTwelve(int hour)
    {
       if(hour > 12)
       {
          return(hour - 12);
       }
       else
       {
          return(hour);
       }
    }
Thread Status:
Not open for further replies.