Translate

Labels

Sunday 12 January 2014

PYRAMID OF STARS

C program to print PYRAMID of stars


Pyramid of stars



main()
{
int i,j,n,space;

clrscr();
printf("Enter the number of rows to be in Pyramid  of stars:");
scanf("%d",&n);
space=n;
for(i=1;i<=n;i++)
{
for(j=1;j<space;j++)
printf(" ");
for(j=1;j<=2*i-1;j++)
printf("*");
printf("\n");
}
getch();
}

                                   TRY THIS

     Right angled triangle of numbers>>>>

No comments: