Time converting program in Java


import java.util.*;
public class TimeConvert
{
public static void main(String args[])
{
Scanner s=new Scanner(System.in);
System.out.println("Enter the value of seconds: ");
int sec=s.nextInt();
int hr=sec/3600;
int min=(sec-hr*3600)/60;
sec=sec-(hr*3600+min*60);
System.out.println(hr+"hours"+" "+min+"minites"+" "+sec+"seconds");
}
}

Comments

Popular posts from this blog

GL_QUAD_STRIP Example In OpenGl

GL_POLYGON Example In OpenGl