while(true)
System.out.println("*");
convert into for loop.
Answers
Answered by
0
Answer:
true will come here please follow me
Answered by
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
English,
7 months ago
English,
7 months ago
Math,
1 year ago
Math,
1 year ago
Business Studies,
1 year ago