In a menu driven program according to the users choice draw one of the
patterns
66666
5555
444
33
2
Answers
Answered by
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
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
Social Sciences,
3 months ago
Math,
3 months ago
English,
3 months ago
Math,
7 months ago
Social Sciences,
7 months ago
Science,
11 months ago
English,
11 months ago