Search This Blog

If you have any problem or question please write in the comments. We will try to solve and send you the solution. Not just that we will also post your problems solution on our blog.

Monday, 8 August 2011

A simple java program using for loop

class simplefor
{
public static void main (String arg[])
{
int a;
for (a=5;a>=0;--a)
{
System.out.print ("\n\t a = "+a);
}

}
}

Note:
        In this program, body of the loop will be executed till a is greater than or equals to 0 and value of a will be printed.

No comments:

Post a Comment