Computer Science, asked by lakshikashah0289, 10 months ago

menu driven program for this pattern ,
########
#######
######
#####
####
###
##
#

Answers

Answered by vaas74
2

class prog{

public static void main(int n){

switch (n)

{

case 1:{

for(int i=n;i>=1;i--)

{

for(int j=1;j<=i;j++)

{

System.out.print("#");

}

System.out.println();

}

break;}

}}}

Note: You mentioned menu driven prog that's why I added switch case otherwise only for pattern, you need to type the whole of for part.

Similar questions