Computer Science, asked by sshwetajain2001, 11 months ago

Design the following pattern by using for loop

Attachments:

Answers

Answered by jaingopal
0

#include<stdio.h>

int main()

{

int i,j;

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

{

 for(j=5;j>i;j--)

 printf("  ");

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

 printf("%d ",j);

 for(j=i-1;j>=1;j--)

 printf("%d ",j);

 printf("\n");

}

}

Similar questions