import java.util.*;
public class array{
public static void main(String[] args){
int num[] = {50,20,45,82,25,63};
int i,j;
System.out.print("Given number : ");
for (i = 0;i <>
{
System.out.print(" " + num[i]);
}
System.out.println("\n");
System.out.print("Accending order number : ");
Arrays.sort(num);
for(i = 0;i <>
{
System.out.print(" " + num[i]);
}
}
}
Program4:
import java.util.*;
|
Output of the program:
C:\chandan>javac array.java
|
No comments:
Post a Comment