Sunday, 17 December 2017

TO PRINT A GIVEN STRING IN A 'X' LIKE PATTERN

In this blog let us see how to print a given string in following fashion-

For example let us take a string "HELLO"
We have to print it this way-

                                             H          O
                                                 E    L
                                                    L        
                                                 E    L
                                             H           O

Let's see the code for this problem-


A sample output for the above program-


For any c++ code ask me in the comments below.
I will code and give you the answer, thus making your homework easy.


No comments:

Post a Comment