# Numeric Pyramid Program in C With Explanation

## Numeric Pyramid Program in C

In this tutorial, we will be going to learn numeric pyramid program in c. In c we can build various pyramids with numbers, alphabets or stars etc. We learn the number based pyramids. Using the numbers we can implement any type of pyramids some examples are as follow:

program – 1

### Implement following numeric pyramid program in c

1

12

123

1234

12345

OutPut :

Number pyramid:

1

12

123

1234

12345

In above program, as we are implementing the pyramid we require the number till which we want to print the pyramid that is we taken i variable to print number from 1 to 5.and for iterating loop we have taken the j variable with prints at each line of a pyramid.

program – 2

### Implement following numeric pyramid program in c

12345

2345

345

45

5

OutPut :

Number pyramid:

12345

2345

345

45

5

In above program, as we are implementing the pyramid we require the number till which we want to print the pyramid that is we taken j variable to print number from 5 to 1.and for iterating loop we have taken the j variable with prints at each line of a pyramid.

program – 3

Implement following numeric pyramid.

55555

45555

34555

23455

12345

Output :

Number pyramid:

55555

45555

34555

23455

12345

In above program, as we are implementing the pyramid as we see the first line contain only 5 so we take from 5 printing 5 times. then we require the variable iteration till which we want to print the pyramid that is we taken i variable. and after that change only number from left according to the iteration value.

program – 4

### implement numeric diamond pyramid

1

121

12321

1234321

12321

121

1

Output :

1

121

12321

1234321

12321

121

1

In above program, as we are implementing the pyramid we break the pyramid into the two parts as upper and lower so that task will be easy. In the first half, we printed the half portion as 1234321. and after that, we printed the last half.

program – 5

//implement following a numeric pyramid

1

23

4

56

7

89

10

Output :

1

23

4

56

7

89

10

In above program, as we are implementing the pyramid we require the number till we want to print pyramid we have taken the i variable for iterating the loop and the r for the number of to print the numbers as we iterate we increment the numbers and print.

program – 6

//implement following numeric pyramid.

1

1 2

1 2 3

1 2 3 4

1 2 3 4 5

OutPut :

Number pyramid:

Enter number till you want pyramid: 5

1

1 2

1 2 3

1 2 3 4

1 2 3 4 5

In above program, as we are implementing the pyramid we require the number till which we want to print the pyramid that is we taken in num variable to print number from 1 to 5.first we print spaces with num-1 and print the first number. after that, we put spaces with num-2 and print 2 numbers and so on till the end.