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…

Read more »

java program to calculate simple interest

java program to calculate simple interest Code: Output:

Read more »

java program to calculate average of 5 numbers

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

Read more »

Java program to calculate the factorial of a given number

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

Read more »

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…

Read more »

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;…

Read more »

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) *…

Read more »

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…

Read more »

Java Program to Check Even or Odd number

Java program to check Even or Odd number Code: import java.util.Scanner; public class Odd_Even { public static void main(String args[]) { System.out.println(“Enter a integer number to check it is odd…

Read more »

How to take user input in java

How to take user input in java Program code: Output:

Read more »
error: Content is protected !!