Write a program in java to read 5 integers and print their


JAVA Programing

Question One

Write a program in Java to read 5 integers and print their sum and average.Use loop statements in your code.

Question Two

Write a program in Java to read 5 integers and print and print the minimum and maximum values.

Question Three

What is the value of mafter running the following code?
int[] m = new int[8];
m[0] = 1;
for (int i = 1; i < m.length; i++) {
m[i] = m[i-1] + i;
}

Question Four

Find and fix the error in each of the following codes:

1. int[ ] a = new int[ 60 ];
for( int h = 0; h<= a.length; h++ )
a[ h ] = 1;

2. ArrayList m = new ArrayList();
m.add(1);
m.add(2);
m.remove(0);

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Write a program in java to read 5 integers and print their
Reference No:- TGS02374398

Now Priced at $20 (50% Discount)

Recommended (96%)

Rated (4.8/5)