https://i2.wp.com/eblogarithm.com/wp-content/uploads/2016/10/Star-Printing--pattern-4-Right-Side-Opposite-Triangle-in-C-Programming.png?fit=640%2C360

Star Printing : pattern 4 (Right Side Opposite Triangle) in C Programming

If you have seen previous patterns then it is very easy. These patterns helped me understanding loops.

Here is my Code :

int p, q, r, k = 5; // “k” is for taking inputs from users.
for (p = 1; p <= k; p++)
{
for (q = 1; q < p; q++)
{
printf(” “);
}
for (r = 5; r >= p; r–)
{
printf(“*”);
}
printf(“\n”);
}

(Visited 68 times, 1 visits today)



There are no comments

Add yours

Leave a Reply

%d bloggers like this: