The code below shows how to print an array using Index basedfor loop and iterator based for loop.Index based for loop:Int[] array={1,2,4,5,7};for (int i = 0; i < array.length; i++)System.out.println(array[i]);Iterator based for loop:for (int datum : array) System.out.println(datum);Now write code generate 10 random numbers and assign it to anarray. Now find the factorial of those 10 random numbers generatedassign it to another array. Now print the output using Iteratorbased for loop and Index based for loop.
Expert Answer
An answer will be send to you shortly. . . . .