Identify the equivalent "for" loop for the given "while" loop below:
int a=1;
while (true)
{
System.out.println (a);
if(a==5)
break;
a++;
}

Posted on by