Simple for loop not working

manta656

New Member
I've just started learning programming. I'm studying for loops butthis program does not work as expected. I want to break the loop when\[code\]$a\[/code\] is equal to \[code\]3\[/code\] so that I get the output \[code\]1 2\[/code\] but I get \[code\]3\[/code\] as output :(\[code\]for($a=0;$a<10;++$a){ if($a==3) break print"$a ";}\[/code\]Please help.
 
Back
Top