pattern printing in c language



print pattern in c language-

#include<stdio.h>
int main()
{
int i,j,k;
for(i=0;i<=10;i++)
{

for(k=0;k<=i;k++)
{
printf("*");
}
for(j=0;j<=20-2*i;j++)
{
printf(" ");

}

for(k=0;k<=i;k++)
{
printf("*");
}
printf("\n");
}
for(i=0;i<10;i++)
{
    for(j=0;j<10-i;j++)
    {
printf("*");
    }
    for(k=0;k<=2*i+2;k++)
   { printf(" ");
   }
   for(int l=0;l<10-i;l++)
   {
       printf("*");
   }
   printf("\n");
}
return 0;
}

output-

iss program ka output
print star pattern in c language
output


code samajh mai nhi aaya to comment box mai puch sakte hain.
you can ask doubt in comment box

Previous
Next Post »