Write a C program to print the following pattern:
*********
*******
*****
***
*
CODE:
#include<stdio.h>
void main()
{
int i,j,k,n;
printf("Enter the number of rows :\n");
scanf("%d",&n);
for(i=n;i>=1;i--)
{
for(k=n;k>i;k--)
{
printf(" ");
}
for(j=i*2-1;j>=1;j--)
{
printf("*");
}
printf("\n");
}
}
OUTPUT:

No comments:
Post a Comment