3 Nov 2009

Convert From Second To Hour And Minutes


Hi guys, let's learn C++ language online again. Now, I want to give you a program code to convert from second to hour and minutes. (click this picture to zoom)

#include <iostream.h>

#include <conio.h>

int main()

{

int input;

int hour;

int minute;

int second;

cout<<"Please input second";cin>>input;

hour = input/3600;

minute = input % 3600/60;

second =input %3600 % 60;

cout<<"\nHour total is ="<<hour;

cout<<"\nMinute total is ="<<minute;

cout<<"\nsecond total is ="<<second;

getch();

}

Join this blog if you want to get more leason!!!

0 comments:

Post a Comment

 

C++ Language Learning Design by Insight © 2009