-->

Header Ads

Pyramid Program 2

C Program:

#include<stdio.h>

#include<conio.h>

void main()

{

int a,b,n;

clrscr();

printf("Enter hieght of pyramid: ");

scanf("%d",&n);

for(b=0;b<n;b++)

{

for(a=0;a<b;a++)

{

printf(".");

}

for(a=n;a>b;a--)

{

printf("*");

}

printf("\n");

}



getch();

}


Output of c program:

No comments

Powered by Blogger.