Question: PleAse show codes in java Thanks 1. Write a program which asks the user to enter an integer value, n. Declare an array of int's
1. Write a program which asks the user to enter an integer value, n. Declare an array of int's of size n. Find every prime number starting with 2, and write each into the next available cell in your array. Repeat this n times until your array is full. Use a while loop to do this. Then, using a for loop, compute the average of your prime numbers. Your n should be a positive integer less than or equal to 1000
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
