Posted by : Unknown Sunday, 28 June 2015

Syntax:

for(initialization; condition; iteration) 
statement;

Program:

class printNumber
{
    public static void main(String args[])
    {
        for(int x=0; x<10; x++)
        {
        System.out.println(x);
        }
    }
}
 

Output:

0
1
2
3
4
5
6
7
8
9

Leave a Reply

Subscribe to Posts | Subscribe to Comments

Welcome to My Blog

Translate

Popular Post

Total Pageviews

Blog Archive

- Copyright © Learning Java Program - Powered by Blogger -