Computer Science, asked by zara2286, 1 year ago

1
33
555
7777
99999
Solve this question

Answers

Answered by mhar6327
1

Answer:

#include<stdio.h>

#include<conio.h>

int main(){

int n,i,j,k,l;

printf("Enter the no of lines: ");

scanf("%d",&n);

for(i=0;i<n;i++){

for(j=0;j<=n-i-2;j++){

printf(" ");

}

for(k=0;k<=i;k++){

printf("%d",k+1);

}

for(l=i-1;l>=0;l--){

printf("%d",l+1);

}

printf("\n");

}

for(i=0;i<=n-2;i++){

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

printf(" ");

}

for(k=0;k<=n-i-2;k++){

printf("%d",k+1);

}

for(l=n-i-3;l>=0;l--){

printf("%d",l+1);

}

printf("\n");

}

getch();

return 0;

}

Similar questions