I have to write a c++ coding for my assigment... the question is write a program to validate a time.. user neeed to enter hour, minute, and second and the time must be checked either valid or not.. if not valid, the program must show in the correct format.. example...
if hour : 1, minute:30,second:26, the cout is time 1:30:26 is valid...

if hour : 3, minute:67,second:11, the cout is time 1:67:26 is not valid...it should be 4:7:11...

pleaz help me asap

Recommended Answers

All 2 Replies

Post the program you have tried to write. Hint: use three integers for keyboard input -- one for hour, another for minutes, and the third for seconds.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.