class TryFor{
public static void main(String[] args){
int sum=0;
for(int i=0;true;i++)
{
sum+=i;
if(i>5)
break;
}
System.out.println(i);
}
}
this code is working but when i put false in place of true it is not compiling can someone tell me why?
i think it should compile but for loop will not execute?