I've just made a few changes.
Code:#include <iostream.h> const int minute = 60; int main () { //Announce purpose of program: cout <<"This program converts seconds to minutes and seconds."<<endl; //User inputs seconds to be converted: int seconds; // to be input from user cout <<"enter seconds: "; cin >> seconds; //Check error state if (!seconds) { cout <<"You must enter intergers only." << endl; return 1; } // if //Convert seconds to minutes and seconds in integers: int second = seconds % minute ; int minutes = seconds/minute; //Display the results: cout << seconds << " seconds is equivalent to " << minutes << " minutes and " << second << " seconds." << endl; return 0; } // function mainin } // function main




Reply With Quote