Hi to everyone.Can somebody help to : Write a program to display all the hour and minute values in a 24-hour clock from 00:00 to 23:59.

Recommended Answers

All 3 Replies

Yes. What code do you have so far? Please note that nobody will do this for you.

Objects: hour, minute
a.  for hour 24 times
i.  for minute 60 times
a.  display hour : minute

but how to make hours ,what are les than 10,to display ,like 00:00,01:00....

Sounds like you just want to pad to 2 digits with 0 as the pad character:

cout << setw(2) << setfill('0') << hour
     << ':'
     << setw(2) << setfill('0') << minute;
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.