Array in Java Questions
Array in Java Questions
•Declaration of array:
int []a=new int[5];
•int []a;
•a=new int [5];
Question:
1)WAP to accept the size of array from user and then accept that many values in the
array display those values
2)WAP to accept to random 7 values from user in the array and
1)print addition of all the elements of that array?
2)print the greatest value from that an array?
3)print the second highest value from an array without changing its original
position?
4)print only prime numbers from an array?
5)print array in ascending order?
6)print reverse order array?