Computer Science, asked by pona, 1 year ago

Write to print this pyramid form in JAVA

 

1                                                                 

12                                                           

123

1234

12345

 

Answers

Answered by saurabhprasad20
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 LOVEPREETL266
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);
}}

pona: fantas Lovepreet thanks plz WAP to find the same pyramid by console input
munmun: public class Q1
pona: will u write whole
Similar questions