Java program to check leap year

A leap year is a calendar year with an extra day on February 29th. A year with an extra day. It has 366 days instead of the standard 365. If the year is divisible by 4 but not by 100, or if the year is divisible by 400, it is a leap year. The purpose of the leap year calculation is to compensate for the mismatch between the earth rotation time and the day hours. In this post, we'll look…

Java program to find prime number

A prime number is a whole number greater than one with only the number one and itself as factors. A factor is a whole number that can be evenly divided by another number. Prime numbers are those that have only two factors. A prime number is a number that is only divisible by 1 and itself. So, prime numbers have only two factors, 1 and the number itself. The programme will loop through the given range of numbers and determine…

Java program to check prime number

A prime number is a number that can only be divided by one and itself. So prime numbers have only two factors: 1 and the number itself. In this post, we’ll look at how to create a java program to Check the given number is a prime number or not. Prime Number A prime number is a number that can only be divided only by 1 and itself. A number is not a prime number if the number is divisible…

Java program to find the factorial of a number

Factorial means multiplying all whole numbers from the chosen number down to one. The java programme will store a number in a variable to find the factorial of that number. The programme will multiply positive integer numbers beginning with 1 until it reaches the specified number. The result of the number multiplication is the factorial of the given number. In this post, we'll look at how to write a Java programme that calculates the factorial of a number. Factorial of…

Java Program to Add Two Numbers

Java Program to Add Two Numbers In this post, we'll look at how to create a java programme to add two numbers. Two numbers are assigned to two java integer variables in the Java programme. The sum of the two numbers will be saved in another java integer variable. The total will be displayed in the java program. package in.yawin; public class AddTwoNumbers { public static void main(String[] args) { int a = 5; int b = 4; System.out.println("a value…