🔒 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
  • 464
    Views
  • 3
    Participants
Last reply from:
Curious Pepe

Trending Topics

Online now

Members online
1,078
Guests online
1,260
Total visitors
2,338

Forum statistics

Threads
2,279,947
Posts
28,994,230
Members
1,226,530
Latest member
pp992
Back
Top