In this article, we will write two java programs to check whether a number is even or odd. If a number is perfectly divisible by… [Read More]
Java Program to display first n or first 100 prime numbers
Program to display first n prime numbers import java.util.Scanner; class PrimeNumberDemo { public static void main(String args[]) { int n; int status = 1; int… [Read More]
Java program to display prime numbers from 1 to 100 and 1 to n
The number which is only divisible by itself and 1 is known as prime number. For example 2, 3, 5, 7…are prime numbers. Here we… [Read More]
Java program to check prime number
The number which is only divisible by itself and 1 is known as prime number, for example 7 is a prime number because it is… [Read More]
java program to check palindrome string using recursion
Program: Check whether String is palindrome using recursion package beginnersbook.com; import java.util.Scanner; class PalindromeCheck { //My Method to check public static boolean isPal(String s) {… [Read More]
Java Program to check Palindrome string using Stack and Queue
In this tutorial, you will learn how to write a java program check whether the given String is Palindrome or not. There are following three… [Read More]
java program to find factorial of a given number using recursion
Here we will write programs to find out the factorial of a number using recursion. Program 1: Program will prompt user for the input number…. [Read More]
Java program to sum the elements of an array
In this tutorial we will see how to sum up all the elements of an array. Program 1: No user interaction /** * @author: BeginnersBook.com… [Read More]
Java Program to Calculate Area of Rectangle
In this tutorial we will see how to calculate Area of Rectangle. Program 1: User would provide the length and width values during execution of… [Read More]
Java program to calculate area of Square
In this tutorial we will learn how to calculate area of Square. Following are the two ways to do it: 1) Program 1: Prompting user… [Read More]