What's new

Closed Branching Statement (break statement) Java

Status
Not open for further replies.

Tomanz

Forum Veteran
Joined
Dec 22, 2015
Posts
985
Reaction
352
Points
528
Age
24
Mga Masters sa programming paguide Naman or paturo Kung panu Yung mag priprint sya ng 1 and 2 but mag loop sya ng 3 times po. Heto po code bahala na po kayu mag edit
public class boom{
public static void main(String[] args)
{
int x=1;
while(x<=5)
{
System.out.println(x);
if(x==2)
{
break;
}
x++;
}
}
}
 
Status
Not open for further replies.

Similar threads

Back
Top