5th tutorial for right angle triangle patterns



This is totally reverse pattern from the pattern in last tutorial. Here pattern starts from ‘E’ instead of ‘A’.





This pattern is in reverse order starts from ‘E’ to ‘EDCBA’. Pattern looks like:



Here we need to change conditions of both FOR loops.



As you can notice from program, outer loop i.e. i loop
For(i=k;i>=1;i--)

Here, k is the no of line we entered, so loop starts with k and then i decrements same way
For(j=k;j>=i;j--)

The inner loop i.e. j loop also decrements as we have to print letters in reverse order.

Printf statement remains same as last tutorial.


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

Post a Comment