1.

Write a program (Using scanner class) to generate a pattern of a token / word in theform of a traiangle or in the form of an inverted triangle depending upon the user’s choice.Sample input : Enter a word as a tokenCLASSSample output:Enter your choice: 1CC LC L AC L A SC L A S SEnter your choice: 2C L A S SC L A SC L AC LC​

Answer»

Answer:

Write a program to generate a triangle or an inverted triangle till n terms BASED upon the user’s choice of triangle to be displayed. Example 1: Input : Type 1 for a triangle and Type 2,for an inverted triangle 1 Enter the number of terms 5 Output : 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 Example 2: Input : Type 1 for a triangle and Type 2 for an inverted triangle 2 Enter the number of terms 6 Output : 6 6 6 6 6 6 5 5 5 5 5 4 4 4 4 3 3 3 2 2 1Read more on Sarthaks.com - https://www.sarthaks.com/840751/program-generate-triangle-inverted-triangle-terms-based-users-choice-triangle-displayed

EXPLANATION:

pls mark as a brainlist pls



Discussion

No Comment Found