Number triangle in C

We can make a number triangle using C programming language. The user will enter the maximum range of the triangle and we will make a program to print the output as a triangle.

If a user gives input 10 as the range of the triangle then the number triangle program will print the output like as following.

enter the range of triangle here : 10
                   1
                 1 2 1
               1 2 3 2 1
             1 2 3 4 3 2 1
           1 2 3 4 5 4 3 2 1
         1 2 3 4 5 6 5 4 3 2 1
       1 2 3 4 5 6 7 6 5 4 3 2 1
     1 2 3 4 5 6 7 8 7 6 5 4 3 2 1
   1 2 3 4 5 6 7 8 9 8 7 6 5 4 3 2 1
 1 2 3 4 5 6 7 8 9 10 9 8 7 6 5 4 3 2 1

Now, we will see the program to print such output bellow.

C program to print a number triangle

// we are updating the page

Output of the number triangle program

number triangle in c

Previous pageFibonacci  triangle

Next pageAlphabet triangle

More C programming and projects

C learning topics