Welcome to the TechSpot OpenBoards. Please read the FAQ if you have any questions. Sign up or Login to participate.
|
|||||||
Download Now:
C program
|
|
Thread Tools | Search this Thread |
|
#1
|
|||
|
|||
|
C program
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
|
|||
|
|||
|
thanks
Nodsu, I appreciate it, that should be enough.
God bless, Katmandu :hotouch: |
|
#3
|
||||
|
||||
|
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);
}
}
|
![]() |
| Similar Topics | ||||
| Topic | Replies | Forum | ||
Looking for a program
|
3 | Software Apps | ||
Program wont get deleted from 'Add or Remove program'. (need help)
|
1 | Windows OS | ||
Com 2 with a dos program?
|
1 | Other Hardware | ||
can not run a program
|
7 | Windows OS | ||
what's that program?!
|
8 | Software Apps | ||
| Thread Tools | Search this Thread |
|
|
All times are GMT -4. The time now is 02:11 PM.



Looking for a program