🔒 Closed Branching Statement (break statement) Java

Status
Not open for further replies.

Tomanz

Eternal Poster
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.

About this Thread

  • 3
    Replies
  • 480
    Views
  • 3
    Participants
Last reply from:
Curious Pepe

Trending Topics

Online now

Members online
1,177
Guests online
4,476
Total visitors
5,653

Forum statistics

Threads
2,330,969
Posts
29,256,043
Members
1,151,356
Latest member
sanen
Back
Top