TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Calculate The Given Year Is Leap Or Not Using Java
Senthilvelan Sambamoorthy
Aug 13
2016
Code
646
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
ssva25.rar
// program to find the given year is leap year or not
import
java.io.*;
class
a25
{
public
static
void
main(String arg[])
throws
IOException
{
int
n;
BufferedReader inp=
new
BufferedReader(
new
InputStreamReader(System.in));
System.out.println(
"\n\t\t\tFinding Leap Year"
);
System.out.println(
"\n\t\t\t~~~~~~~~~~~~~~~~~"
);
System.out.print(
"\nEnter the Year: "
);
n=Integer.parseInt(inp.readLine());
if
( (n%
400
==
0
)||( (n%
100
!=
0
)&& (n%
4
==
0
)) )
{
System.out.println(
"This Year "
+n+
" is a Leap Year"
);
}
else
{
System.out.println(
"This Year "
+n+
" is a not Leap Year"
);
}
}
}
Java