India's Largest Free Online Education Platform

## Java program to check prime number

Java program to check prime number Code: import static java.lang.System.out; import java.util.Scanner; public class Prime_no { public static void main(String args[]) { int flag=0; out.println(“Enter a number to check it…

## java program to calculate simple interest

java program to calculate simple interest Code: Output:

## java program to calculate average of 5 numbers

Java program to calculate average of 5 numbers Code: Output:

## Java program to calculate the factorial of a given number

Java program to calculate the factorial of a given number Code: Output:

## Java program to print numbers from 1 to N using for loop

Java program to print numbers from 1 to N using for loop Code: import java.util.Scanner; public class Counting_no { public static void main(String args[]) { Scanner Sc= new Scanner(System.in); System.out.println(“Enter…

## java program to calculate the area of a rectangle

java program to calculate the area of a rectangle Code: import static java.lang.System.out; public class AreaOfRectangle { public static void main(String args[]) { float length=5, breadth=10; double area = length*breadth;…

## Java program to calculate the area of a circle

Java program to calculate the area of a circle Code: import static java.lang.System.out; public class AreaOfCircle { public static void main(String args[]) { float radius=5; double area = (3.14) *…

## java program to add two numbers

Java program to add two numbers Code: public class Add { public static void main(String args[]) { int a=5, b=10; int c; c= a + b; System.out.printf(“Sum of a:%d and…