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

Trending Topics

Online now

Members online
1,333
Guests online
3,386
Total visitors
4,719

Forum statistics

Threads
2,305,879
Posts
29,168,309
Members
1,195,477
Latest member
Jomar Gabriel
Back
Top