C Programming Code Examples C > Pyramid Patterns Code Examples C Program to Print the Double Pyramid Pattern C Program to Print the Double Pyramid Pattern #include<stdio.h> int main() { int x, y, k; int blank = 0; int lines = 6; char symbol = 'A'; int temp; int diff[7] = { 0, 1, 3, 5, 7, 9, 11 }; k = 0; //Step 0 for (x = lines; x >= 0; x--) { printf("\n"); symbol = 'A'; //step 1 for (y = x; y >= 0; y--) { printf("%c\t", symbol++); } //step 2 blank = diff[k++]; //step 3 - Double space for (y = 0; y < blank; y++) { printf("\t"); } symbol = 'F' - (blank / 2); if (blank == 0) { temp = x - 1; } else { temp = x; } for (y = 0; y <= temp; y++) { //step 4 printf("%c\t", symbol--); } } return (0); }