Read on full site | Join TechSpot! (it's free) | Bookmark / Share this



C program

katmandu
02-19-2006, 03:31 PM
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.

katmandu
02-20-2006, 06:40 PM
Nodsu, I appreciate it, that should be enough.

God bless,

Katmandu :hotouch:

Ad
02-20-2006, 06:40 PM
  

Nodsu
02-21-2006, 08:23 AM
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..

int toTwelve(int hour)
{
if(hour > 12)
{
return(hour - 12);
}
else
{
return(hour);
}
}

Post a reply, see related topics & more

Tip: Download Advanced SystemCare 3 Free - Clean, Repair, Protect & Optimize your PC.



 Top Technology News

TechSpot Blog: Disable Windows automatic check for solutions after a program crashes

Tech Tip of the Week: Unearth Region-Specific Windows 7 Themes

Samsung intros 2TB, eSATA-packing Story Station Plus external HDD

Gartner: PC shipments to grow 2.8% in 2009, revenue down 11%

Microsoft issues warning for IE6, IE7 security hole

LG X120 netbook to launch in the US for $180 with two-year AT&T contract

Intel's six-core Gulftown processor benchmarked months early

Another iPhone worm spotted, this time it's dangerous

More Tech News

  
 Software Downloads

FlashGot 1.2.0.9

RemoveIT Pro XT - SE 23.11.2009

Vuze (Formerly Azureus) 4.3.0.4

RemoveIT Pro v7 Enterprise 23.11.2009

Aloaha PDF Suite 3.9.172

Blindwrite Suite 6.3.1.5

RemoveIT Pro v7 Ultra 23.11.2009

More Downloads



Copyright © 1998-2009 TechSpot.com. TechSpot is a registered trademark. All Rights Reserved.