/* Pyramid Traingle
*******
******
***
*
*/
#include<stdio.h>
#include<conio.h>
void main()
{
int i,n,j;
clrscr();
printf("\n Please Give The Value of N: ");
scanf("%d",&n);
for(i=n;i>0;i--)
{
for(j=n-i;j>0;j--)
printf(" ");
for(j=2*i-1;j>0;j--)
printf(" *");
printf("\n");
}
getch();
}
Previous
Next
*******
******
***
*
*/
#include<stdio.h>
#include<conio.h>
void main()
{
int i,n,j;
clrscr();
printf("\n Please Give The Value of N: ");
scanf("%d",&n);
for(i=n;i>0;i--)
{
for(j=n-i;j>0;j--)
printf(" ");
for(j=2*i-1;j>0;j--)
printf(" *");
printf("\n");
}
getch();
}
Output:
No comments:
Post a Comment