Write to print this pyramid form in JAVA
1
12
123
1234
12345
Answers
Answered by
2
int size = 20; for(int row=1;row<=size;row++){ int a = row; while(a++ <(size-1)){ System.out.print(" "); } int x = 2*row-1; for(a =row;a<x;a++){ System.out.print(""+(a%10)); } for(a=x;a>=row;a--){System.out.print(""+(a%10)); } System.out.println()
Answered by
2
public class Numb
{
public static void main(string arr[])
{
for(int i=1;i<=5;i++)
{
for(int j=1;j<=i;j++)
{
out.println(i);
}}
{
public static void main(string arr[])
{
for(int i=1;i<=5;i++)
{
for(int j=1;j<=i;j++)
{
out.println(i);
}}
pona:
fantas Lovepreet thanks plz WAP to find the same pyramid by console input
Similar questions