Q:

Calculate Convert Year To Day, Hour, Minutes, Seconds Using Java

0

This Program is used to calculate concert year to day, hour, minutes, seconds using Java.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

//convert year to day,hour,minutes,seconds 

import java.io.*; 

class ssva29 
{ 
public static void main(String arg[]) throws IOException 
{ 
int yy; 
double dd,hr,min,sec; 
BufferedReader inp=new BufferedReader(new InputStreamReader(System.in)); 
System.out.print("\n\nEnter the Year: "); 
yy=Integer.parseInt(inp.readLine()); 
dd=yy*365; 
hr=yy*(365*24); 
min=yy*(365*24*60); 
sec=yy*(365*24*60*60); 
System.out.println("\nDays: "+dd+"\nHours: " + hr+"\nMinutes: "+min+ "\nSeconds: " + sec); 
} 
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now