3rd tutorial for right angle triangle patterns



This is the another pattern like the pattern explained in 2nd tutorial, only little difference in loop conditions.




Now here is the solution for pattern no a2

       

Here, as you can see starting from ‘ABCDE’ we have to reach ‘E’ in decreasing order so we have to decrement the first FOR loop i.e.  i loop.



Here for loop will change as  for(i=k;i>=1;i--) as you can note i is decremented.as we want to start print letters from end to start or we can say in reverse order

Printf statement will remain same as of last tutorial for this pattern as we have to print characters only.


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

Post a Comment