Number Pattern 40-Pyramid pattern in C programming
Contents
hide
In this program, we will see the Pyramid pattern numbers in C programming language. Please look into the program.
1 2 6 3 7 10 4 8 11 13 5 9 12 14 15
The C program for Pyramid pattern is as follows:
#include<stdio.h> int main() { int a,b,c; for(a=1;a<=5;a++) { c = a; for(b=1;b<=a;b++) { printf("%d ", c); c += 5-b; } printf("n"); } getch(); return 0; }