Pyramid Program 4
C Program:
#include<stdio.h> #include<conio.h> void main() { int a,b,k; clrscr(); printf("Enter Height of pyramid : "); scanf("%d",&k); for(a=k;a>0;a--) { for(b=0;b<=a;b++) { printf("*"); } printf("\n"); } for(a=0;a<=k;a++) { for(b=0;b<=a;b++) { printf("*"); } printf("\n"); } getch(); }Output of c program:
No comments