Computer Science, asked by anoushkaatulasi75, 1 year ago

while(true)
System.out.println("*");
convert into for loop.

Answers

Answered by aarjooyadav31
0

Answer:

true will come here please follow me

Answered by priyaag2102
0

The loop given to us is a while loop i.e. it will run infinitely many times and will never stop because there is no condition in the while statement. Whereas the statement will always return true irrespective of any condition and will keep printing the '*' character.

Explanation:

The loop given to us is a while loop i.e. it will run infinitely many times and will never stop because there is no condition in the while statement. Whereas the statement will always return true irrespective of any condition and will keep printing the '*' character.

The given loop can be rewritten using a for loop:-

for(i=1;i>0;i++)

{

system.out.print("*");

}

Similar questions