Computer Science, asked by ruhi10, 1 year ago

write a program to display all natural numbers from 1 to 10

Answers

Answered by Kristen999
2
To show the natural number count the table of 2
Answered by shukoor
2
Here's the Java program for your question :

public class natural_nos_1_10
{
public static void main ( )
{
int sum=0;
for ( int x=1;x<=10;x++)
{
sum=sum+x;
}
System.out.println ( "Total sum ="+sum);
}
}

Similar questions