pattern printing in c language using loop

pattern printing in c language using loop


#include<stdio.h>

int main()

{

    int i,j,k;

    for(i=0;i<=5;i++)

   {



 

    for(j=0;j<=i;j++)

    {

        printf("%d",j);

   }
for(k=0;k<=10-(2*i);k++)
{
    printf(" ");
}
int l=i;
for(l=i;l>=0;l--)
{
    printf("%d",l);
    }
   printf("\n");

   }

   return 0;
}

output-

pattern printing in c language
output


doubt comment box mai puche
ask doubt in comment box.
Previous
Next Post »