23
4 5 6
8 9 10
11 12 13 14 15 find the series in java
Answers
Answered by
0
Answer:
import java.util.*;
class pattern
{
public static void main(String args[ ])
{
Scanner sc =new Scanner (System.in);
System.out.println("Enter the range ");
int n=sc.nextInt();
int k=1;
for(int i=1;i<=n;i++)
{
for(int j=1;j<=i;j++)
{
System.out.print(+k);
k=k+1;
}
System.out.println(" ");
}
}
}
Similar questions