while(++z<=d);
29. Write a program to print 17 natural numbers using a for() loop.
30. Write a program to print natural numbers from 20 to 1 using a for()
Answers
Answered by
1
Explanation:
The first 10 natural nos are:
1
2
3
4
5
6
7
8
9
10
Explanation:
public class Exercise10 {
public static void main(String[] args)
{
int i;
System.out.println ("The first 10 natural numbers are:\n");
for (i=1;i<=10;i++)
{
System.out.println (i);
}
System.out.println ("\n");
}
}
Similar questions
Math,
1 month ago
English,
1 month ago
English,
3 months ago
India Languages,
3 months ago
Hindi,
10 months ago