Java Program how to find second largest number in array

Program: public class SecondLarge { public static void main(String[] args) { int[] a = { 25, 122, 33, 45, 56 ...

Java Code To Check Print Array Elements (Using For Loop)

Program: public class Array { public static void main(String[] args) { int a[] = new int[] { 1, 2, 3, ...

Java Code To Check Fibonnaci Series

Explanation: Fibonacci series means the next number is the sum of the previous two number. The First two number is ...

Java Code To Check Print the Reverse Of a Given Number

EXPLANATION:- Here we see how to reverse a program using while loop. STEP1: First write the class name and declare ...

Java Code To Check Swap with Variable

EXPLANATION: step1: Write the class name and declare the main method. step2: Initalize the variable int a,b,temp. step3: Give the ...

Java Code To Check Print Square Pattern Program

Program: public class squarePattern { public static void main(String[] args) { int size=9; for(int i=0;i<size;i=i+2) { for(int j=0;j<size;j++) { System.out.print("*"); ...

Java Code To Print Check Number Pattern Program

Program: public class Pattern2 { public static void main(String args[]) { int a=1; for(int i=1;i<=9;i=i+2) { for(int j=1;j<=i;j++) { System.out.print(a); ...

Java Code To Check Print Right Triangle Star Pattern

Program: public class Pattern1 { public static void main(String args[]) { for (int i = 1; i <= 5; i++) ...

Java Code To Check Power Of Two Numbers. Ex: i/p 5 and 8 o/p 5^8=?

Program: public class Power { public static void main(String[] args) { int a = 5, b = 8; int n ...

Java Code To Check Average of First 100 Prime Number?

Program: import java.util.Scanner; public class Avg { private static double a; public static void main(String args[]) { int number = ...