Computer Applications
Related Questions
Write a program to display the pattern:
A B C D E
A B C D A
A B C A B
A B A B C
A A B C DWrite a program to accept a word (say, BLUEJ) and display the pattern:
B L U E J
L U E J
U E J
E J
JWrite a program to display the pattern:
A B C D E
B C D E
C D E
D E
EWrite a program to generate a triangle or an inverted triangle till n terms based upon the User’s choice of the triangle to be displayed.
Example 1:
Input: Type 1 for a triangle and
Type 2 for an inverted triangle
Enter your choice 1
Enter the number of terms 5
Sample Output:* * * * * * * * * * * * * * *
Example 2:
Input: Type 1 for a triangle and
Type 2 for an inverted triangle
Enter your choice 2
Enter the number of terms 5
Sample Output:A B C D E A B C D A B C A B A