-->

3/24/19

pattern printing in c language using loop

pattern printing in c language using loop

Write a C program to print the given number pattern using loop. How to print the given number pattern using loop in C programming. Logic to print the given number pattern using C program.

Example

Input

Input N: 5

Output

solution for this pattern printing  problem-


#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.

Advertiser

all right reserved @technicalkeeda.in. Powered by Blogger.