Program to show the use of Labeled Break Statement in Java

publicclass JAVA_034
{

publicstaticvoid main(String[] args)
{
int nValues=50;

System.out.println("The Prime Numbers from 1 to 50 are : ");

OuterLoop:

for(int i=1;i<=nValues;i++)
{
for(int j=2;j
{
if((i%j)==0)
break OuterLoop;
}

System.out.println(i);
}

System.out.println("The rest of the Loop iterations were skipped as 4 is not a Prime Number");
}
}

We Are Founder..