FaltuTech.Club : Fane of Advanced Logical Thriving Utopian Technical Club

Bubble Sort in Java



import java.io.*;
class Bubble{
	public static void main(String args[])throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int arr[] = new int[20];
		System.out.print("Enter the number of elements : ");
		int elements = Integer.parseInt(br.readLine());
		for(int i=0;iarr[j]){
					temp=arr[i];
					arr[i]=arr[j];
					arr[j]=temp;
				}
			}
		}
		
		// print elements
		
		for(int i=0;i