Navigate back to the homepage

A Program to print upside down triangle pattern with some fuzzy logic in C

Vishnu Damwala
March 3rd, 2020 · 1 min read

A tutorial to pattern in C - language

Working example:

1/**
2 * 5 5 5 5 5
3 * 20 20 20 20
4 * 60 60 60
5 * 120 120
6 * 120
7 */
8#include <stdio.h>
9int main()
10{
11 int start, end = 1, i, j, n, result;
12 printf(" Enter starting value: ");
13 scanf("%d", &start);
14 result *= start;
15 for (i = start; i >= end; i -= 1)
16 {
17 for (j = start; j > i; j -= 1)
18 {
19 printf("\t");
20 }
21
22 for (j = i; j >= end; j -= 1)
23 {
24 printf("\t %d \t", result);
25 }
26 result *= (i - 1);
27 printf("\n");
28 }
29 printf("\n");
30 return 0;
31}

More articles from MeshWorld

A Program to find sum of series from starting number to ending number using for loop in C

A Program to to display sum of series from starting number to ending number using for loop in C.

March 2nd, 2020 · 1 min read

A Program to display factorial of specified number using for loop in C

A Program to display factorial of specified number using for loop in C.

March 1st, 2020 · 1 min read
© 2017–2020 MeshWorld
Link to $https://twitter.com/meshworldindiaLink to $https://facebook.com/meshworldindiaLink to $https://instagram.com/meshworld.india/