WAP to find print numbers from 1 to 10.

1 year ago
OOP Java

Compile code:

public class Print1to10 {
    public static void main(String[] args)
    {
    
        System.out.println("Output is : ");

        for(int i = 1; i <= 10; i++)
        {
            System.out.println(i);
        }
    }
}

 

Output:

 

0
Dipti KC
Jan 8, 2023
More related questions

Questions Bank

View all Questions