For a given value N, denoting the number of Charters starting from the A, print reverse character bridge pattern.
Input : n = 5 Output : ABCDEDCBA ABCD DCBA ABC CBA AB BA A A Input : n = 8 Output : ABCDEFGHGFEDCBA ABCDEFG GFEDCBA ABCDEF FEDCBA ABCDE EDCBA ABCD DCBA ABC CBA AB BA A A
- For a given value N, reflect the number of characters taking part in the pattern, starting from A. For N = 5, Participating character would be A B C D E.
- By using a nested for loop we would compute the logic. Where the outer loop of ‘i’ would range from 0 to N and the inner loop of ‘j’ would range from 65(Start) to 64 + 2*N.
- Under which we would check the required condition for the pattern design. For all the values of j which are less than ((64+n)+ i) it would print the (char)((64 + n)-( j % (64+n))) and for all the values of j <= ((64+n) -i) it would print (char)j.
ABCDEFEDCBA ABCDE EDCBA ABCD DCBA ABC CBA AB BA A A
- Program to print a inverse pyramid character pattern
- Program to print the pattern 'G'
- Program to print the given H Pattern
- Program to print the pattern "GFG"
- Program to print the given Z Pattern
- Program to print the pattern ‘D’
- Program to print pattern
- Program to print Reverse Floyd's triangle
- Program to print ASCII Value of a character
- Program to print Swastika Pattern
- Program to print Step Pattern
- Program to print number pattern
- Program to print V and inverted-V pattern
- Program to print pyramid pattern
- Program to print circle pattern
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : Mithun Kumar