java program to display first ten natural numbers using while loop
Answers
Answered by
1
Answer:
public class Natural.
int x, i = 1 ;
int sum = 0;
System. out. println("Enter Number of items :");
Scanner s = new Scanner(System.
x = s. nextInt();
while(i <= x)
sum = sum +i;
Similar questions