// programe of Pascal star
#include
#include
void main()
{
clrscr();
int i,n,j,k;
printf("enter the no. of rows=");
scanf("%d", &n);
printf("\n");
for(i=1;i<=n;i++)
{
for(k=n-i;k>0;k--)
printf(" ");
for(j=1;j<=i;j++)
printf(" *");
printf("\n\n");
}
getch();
}
Algorithm
· Start
· Declare i, n, j, k as integer
· Write("the no. of rows=")
· Read(“the no. of rows=”)
· write("in next line");
· for(i=1;i<=n;i++)
· for(k=n-i;k>0;k--)
· Write (" ")
· for(j=1;j<=i;j++)
· Write (" *")
· Write("in next line")
· Stop
0 comments:
Post a Comment