seconds - seconds = (number_of_sec%3600)%60; cout...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
# include <iostream> using namespace std; int main (void) { int number_of_sec, hours, minutes, seconds; cout << "Enter a number between 0 and 21,600\n"; cin >> number_of_sec; hours = number_of_sec/3600; minutes = (number_of_sec%3600)/60;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: seconds = (number_of_sec%3600)%60; cout &lt;&lt; &quot;The number of seconds entered is equivalent to:\n&quot;; cout &lt;&lt; hours &lt;&lt; &quot; hours &quot; &lt;&lt; minutes &lt;&lt; &quot; minutes and &quot; &lt;&lt; seconds &lt;&lt; &quot; seconds&quot;; return 0; }...
View Full Document

This note was uploaded on 04/24/2010 for the course COS 120 taught by Professor Bonev during the Fall '08 term at American University in Bulgaria.

Ask a homework question - tutors are online