C Programming Code Examples C > Pyramid Patterns Code Examples Program to print half pyramid a using numbers Program to print half pyramid a using numbers C Programming Code To Create Pyramid and Pattern #include <stdio.h> int main() { int x, y, rows; printf("Enter number of rows: "); scanf("%d",&rows); for(x=1; x<=rows; ++x) { for(y=1; y<=x; ++y) { printf("%d ",y); } printf("\n"); } return 0; }