Home
Tutorials
Core Java
Introduction To Java
Java Evolution
Overview of Java
Constants, Variables and Data Types
Java Operators
Branching Statements
Looping Statements
Classes, Objects and Methods
Inheritance
Array, String and Vectors
Java Interfaces
Java Packages
Applet Programming
Graphics Programming
Advanced Java
Java AWT
Java Event Handling
Java File Handling
Java MultiThreading
Java Swing-I
Java Swing-II
Exception Handling
Socket Programming
Java Database
Java RMI
Java Servlets
Java Beans
Programms
Projects
Downloads
Contact
Java Programming
!doctype>
Write A Program to check that given year is leap year or not using if-else...
"LeapYear.java"
import java.io.*; import java.io.*; class LeapYear { public static void main(String args[]) throws IOException { String n; System.out.println("\n\nEnter the Year:\t"); BufferedReader ob=new BufferedReader(new InputStreamReader(System.in)); n = ob.readLine(); int leap_year = Integer.parseInt(n); if(leap_year % 4 == 0) { System.out.println("\n\tThis Year is Leap"); } else { System.out.println("\n\tThis Year is not Leap"); } } }
Output of "LeapYear.java"
Read more »
Download Complete Program
-
No comments:
Post a Comment
No comments:
Post a Comment