Want to become a Vibe Coder? Join Vibe Coding Training here
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Calculate Convert Year To Day, Hour, Minutes, Seconds Using Java
WhatsApp
Senthilvelan Sambamoorthy
Aug 13
2016
2.9
k
0
0
ssva29.rar
//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());
// note: to calculate for leap year
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);
}
}
Java
Up Next
Calculate Convert Year To Day, Hour, Minutes, Seconds Using Java