Write a program to display first 10 natural number in java

 Write a program to display first 10 natural number in java

public class DisplayNatural
{
    public static void main(String args[]){
        System.out.println("Display first 10 natural number");
        for(int i=1;i<=10;i++){
            System.out.println(i);
        }
    }
}

Output
Display first 10 natural number 1 2 3 4 5 6 7 8 9 10

Comments

Popular posts from this blog

Make a GST Calculator using HTML and JavaScript

How to make simple bill maker by using python tkinter

Write a program to find the sum of 1/2+4/3+5/6+8/7+9/10 using loop in java