Computer Science, asked by devilgamers850, 9 months ago

In a menu driven program according to the users choice draw one of the
patterns
66666
5555
444
33
2​

Answers

Answered by velvissilva2005
0

Answer:

class number_pyramid

{

   public static void main(String[] args)

   {

       for(int r=6;r>=1;r--)

       {

           for(int c=1;c<=r;c++)

           {

               System.out.print(r);

           }

           System.out.println();

       }

   }

}

Answered by sohampal167
0

Answer:

I can't find the second pattern,so I'm writing the pattern given in the question

Explanation:

int i,j;

for ( i=6 ; i>=2 ; i--)

{

for ( j= i ; j > = 2 ; j--)

{

System.out.print (i) ;

}

System.out.println( ) ;

}

I have just written the loop body part...hope you will understand.

Similar questions