Theory
Write a program in C to generate following pattern using unformatted input/output functions only.
*
* * *
* * * * *
* * * * * * *
* * * * * * * * *
Source Code
#includeint main() { int i, j, rows, k=0; printf("Enter number of rows: "); fflush(stdout); scanf("%d", &rows); for (i=1; i<=rows; i++,k=0) { for (j=1; j<=rows-i; j++) { printf(" "); } while (k!=2*i-1) { printf("* "); k++; } printf("\n"); } return 0; }
From Pattern Printing in C · C programming
Write a program in C to generate following pattern using unformatted input/output functions only.
C Program to Print Floyd's Triangle.
Program to print pyramid using numbers
C program to print following Pyramid:
C program to print following Pyramid:
C Program to print half pyramid a using numbers
C program to print following Pyramid:
C program to print following Pyramid: