Discussion Locked

C Programming question, Please Help!

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

What up peoples. I despirately need to know if any one can briefly explain to me the process of writting small C program that would accepts a user-entered time in hours and minutes, then have the program display the time one minute later.

Thank You
HyMeno

2 replies

by jay eckles

I won't write the program for you, but here's a few places to start:
look at scanf() or something similar to accept the input
look at time() and the time_t structure to deal with time
look at printf() or something similar to display output.
These are all standard library functions. You should not have any trouble with this assignment if you know C.

Good luck.

Jay
www.jayeckles.com

by mmmova

this is a fairly simple program. Here is the coding....Hope it will work

include
include
include

void main()
{
int hours,min;

printf("\nEnter current hours and minutes: ");
scanf("%3d:%3d,&hours, &min);
delay(60000); //time is given in millisecs
++min;
clrscr();

printf("\nThe current time is %d hours and %d minutes",hours,min);

getche();

}

This discussion is closed to new replies.