4th tutorial for right angle triangle patterns



Here is another interesting pattern like explained in earlier tutorials. In this there is some variations in inner loop.




Here is the solution for the pattern looks like:



As you can see here we have to arrange letters in reverse order such as from ‘EDCBA’  to ‘A’.  So to perform this we need to change inner loop i.e. j loop.



As shown in figure above, inner loop is decremented i.e. j is decremented.
For(j=i;j>=1;j--)

J is decremented as we wanted to print letters in reverse order.

Here printf statement will remains same as of last tutorial.


{ 0 comments ... read them below or add one }

Post a Comment