Program Description:
This is the program in which we are going to print a pattern with '*' using loops. We are going to print a shape similar to right angled triangle. This is a very interesting code and it will help you to clear the concept of for loop very easily. We will use two for loops to print the pattern. The algorithm is such that the number of * is the line number. For Example, in the 1st line there is one *, in the second there are two * and so on. The first loop is used to determine the line and the second loop prints the number of stars according to the line number. The line printf("\n"); is used to change the line. This is the first program of pattern series which you must do, irrespective of for what you are doing C programming.
0 Comments