WRITE A C PROGRAM TO PRINT PYRAMID STAR - Code

Latest

programs

Sunday, October 30, 2011

WRITE A C PROGRAM TO PRINT PYRAMID STAR


WRITE A PROGRAM TO PRINT PYRAMID STAR

#include<stdio.h>
#include<conio.h>
void main()
{
int i,a,j,k;
clrscr();
printf(“enter the number of line \n”);
scanf(“%d”,&a);
for(i=0;i<a;i++)
{
printf(“\n”);
for(j=0;j<10-i;j++)
{
printf(“ ”);
}
for(k=0;k<=2*i;k++)
{
printf(“*”);
}
}
getch();
}

1 comment: