Ettianz Blog
Home
Programming
C Language
Dos Command
PSO2
Character Voice Youtube
About me
How to use nested for loops to print pyramid and inverted pyramid on console
Code :
#include
#include
int main() { int e = 1; int i, j, k; for (i = 1; i <= 5; i++) { for (j = 4; j >= i; j--) { printf(" "); // Printing Blank Space } for (k = 0; k < e; k++) { printf("*"); //Printing * } printf("\n"); e = e + 2; } system("pause"); }
How to use nested for loops to print invert pyramid on console
Code :
#include
#include
int main() { int e2 = 9; int m, n, o; for (m = 1; m <= 5; m++) { for (n = 0; n
Newer Post
Older Post
Home