Can anyone say what is the mistake in the following program:
import java.util.*;
class Bubble_Sort
{
int s,i,x,t,l,j,m;
public void Input()
{
Scanner in= new Scanner(System.in);
System.out.println("Enter the size of the string");
s=in.nextInt();
int m[]=new int[s];
for(i=0;i<s;i++)
{
System.out.println("Enter the number to be sorted");
m[i]=in.nextInt();
}
}
public void Sort()
{
for(i=0;i<(s-1);i++)
{
for(j=0;j<(s-i);j++)
{
if(m[j]>m[j+1])
{
t=m[j];
m[j]= m[j+1];
m[j+1]=t;
}
}
}
}
public void Output()
{
System.out.println("The Sorted Arrangement of the given number are:");
for(l=0;l<s;l++)
{
System.out.println(m[l]);
}
}
public static void main(String args[])
{
Bubble_Sort ob= new Bubble_Sort();
ob.Input();
ob.Sort();
ob.Output();
}
}
Answers
Answered by
1
Answer:
The main forms of precipitation include drizzling, rain, sleet, snow, ice pellets, graupel and hail. Precipitation occurs when a portion of the atmosphere becomes saturated with water vapor (reaching 100% relative humidity), so that the water condenses and "precipitates" or falls.
Similar questions