Q:

Java program to print numbers from 1 to 10 using for loop

0

Java program to print numbers from 1 to 10 using for loop

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Program to print the number from 1 to 10 using for loop in java

package IncludeHelp;

public class Print_1_To_10_UsingFor 
{
	public static void main(String[] args)
	{
		//print the result
		System.out.println("Output is : ");

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

Output

Output is : 
1
2
3
4
5
6
7
8
9
10

 

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now