0
What is iteration ?
5 Respostas
0
Don't understand
0
Give an example
0
This block print the number 0 to the 9
for(int number=0;number<=9;number++)
System.out.println(number);
0
Iteration menace looping or running (executing) a block of code again and again repeatedly.
For example i want output like this:-
Hii
Hii
Hii
Hii
Hii
So code like this would be a peace of stupidity:-
System.out.println("Hii);
System.out.println("Hii);
System.out.println("Hii);
System.out.println("Hii);
System.out.println("Hii);
So if we put the System.out.println("Hii); statement in a loop so it would executed multipal times by computer like this:-
int i =0;
while(i<5)
{
System.out.println("Hii);
i++;
}