Showing posts with label continue. Show all posts
Showing posts with label continue. Show all posts

Sunday, September 22, 2013

, , , , , ,

Program to iluustrate use of Break & Continue in java


Code Box
--------------------
/*Program to print table of all odd numbers less than 10. Useing flowcontrol
terms  Break & Continue. */

class flowbc
{
public static void main(String r[])
{
int a,b;

for(a=1;;a++)
{

if(a>=10)
{ break;
}
else
if(a%2==0)
{continue;
}
else
{
for(b=1;b<=10;b++)
{
System.out.print("  "+b*a);
}

}

System.out.print("\n");
}
}
}


Publisher: Brijmohan Lal Sahu - 3:41 PM