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

Calculate Compound Interest in JavaScript

How to make simple bill maker by using python tkinter

Admin Login Page Using HTML and CSS