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.
{
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