write a program to print first 15 natural numbers...
amannishad0512p5zxh6:
First of all tell me, in which programming language
Answers
Answered by
2
{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}
hope this will help you
hope this will help you
Answered by
10
Answer:
public class Test
{
void prnNaturalNos( )
{
int i = 1 ;
for (i= 1 ; i < = 15 ; i++)
System.out.print( i ) ;
}
}
Output Produced is:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
The For loop:
The for loop is the easiest to understand of the Java loops.
All its loop-control elements are gathered in one place (on the top of the loop) , while in the other loop construction of Java, they (top-control elements) are scattered about the program.
Similar questions