What do you mean by finite and infinite loop?
Answers
the loop which could be determined is finite loop .As in a finite loop no. of illterations are known before .
The loop whose no. of illterations are unknown or would run infinite times is known as infinite loop.
Answer:
Explanation:
The loop which could be determined is finite loop .As in a finite loop no. of iterations are known before .
example program to implement finite loop:
public class finite_loop
{
public static void main (string args [ ] ) // main function declared as static and public
{
for ( int i = 1 ; i <= 5 ; i++ )
system. out. println ( "value of i = " + i ) ;
}
}
The loop whose no. of iterations are unknown or would run infinite times is known as infinite loop.
example program to implement infinite loop:
public class infinite_loop
{
public static void main (string args [ ] ) // main function declared as static and public
{
for ( ; ; )
system. out. println (" hello " ) ;
}
}