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

Trending Topics

Online now

Members online
975
Guests online
6,386
Total visitors
7,361

Forum statistics

Threads
2,354,112
Posts
29,382,209
Members
1,079,330
Latest member
yudhanomee
Back
Top