Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The code below shows how to print an array using Index based for loop and iterator based for loop. Index based for loop: Int[] array={1,2,4,5,7};
The code below shows how to print an array using Index based for 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 an array. Now find the factorial of those 10 random numbers generated assign it to another array. Now print the output using Iterator based for loop and Index based for loop.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started