Star Pattern3

Click On Image To ZOOM
//Code

#include<stdio.h>
main()
{
int i,j,k,n;
printf("Enter no of lines\n");
scanf("%d",&n);
for(i=0;i<n;i++)
{
for(j=0;j<n-1-i;j--)
{
printf(" ");
}
for(k=0;k<2*i+1;k++)
{
printf("*");
}
printf("\n");
}
}

No comments:

Post a Comment