Computer Science, asked by ranjitajoshi83, 8 months ago

write a Java program to print all natural numbers from 1 to 10 using loop method​

Answers

Answered by shamimsh355
0

Answer:

please mark me as brainliest and thanks me please

Explanation:

Java Program to Print Natural Numbers from 1 to N import java.util.Scanner; public class NaturalNumbers1 { private static Scanner sc; public static void main(String[] args) { int number, i; sc = new Scanner(System.in); System.out.print(" Please Enter any Number : "); number = sc.nextInt(); for(i = 1; i <= number; i++) { System.out.print(i +"\t"); } } }

OUTPUT

ANALYSIS

First, we used the Java For loop to iterate from 1 to maximum value (Here, number = 6).

Similar questions