dimanche 1 janvier 2023

c program about hollow number pattern

Write a C program to print hollow number pattern series using for loop

Example

Input

5

OUTPUT :

123456

2 5

3 4

4 3

5 2

654321

#include<stdio.h>
int main()
{
int i,j,m,n,a;
scanf("%d",&a);
for(i=1;i<=a+1;a++)
{
    for (j=1;j<=a+1;j++)
    {
        for(m=1;m<=a+1;m++)
        {
            for(n=1;n<=a+1;n++)
            {
               printf("%d",n);
            }
          printf(" ");  
        }
    }printf("\n");
printf("\n");
}
}

Aucun commentaire:

Enregistrer un commentaire