Print the pattern
5 5 5 5 5
4 4 4 4
3 3 3
2 2
1
Answers
Answered by
1
Answer:
how to generate pattern above pattern using c i tried this
int i, j, N;
scanf("%d", &N);
for(i=N; i>=1; i--)
{
//Logic to print spaces
for(j=N; j>i; j--)
{
printf(" ");
}
//Logic to print numbers
for(j=1; j<=i; j++)
{
printf("%d ", i);
}
for(j=N; j>i; j--)
{
printf(" ");
}
printf("\n");
}
Explanation:
(‐^▽^‐)
Answered by
3
Attachments:
Similar questions
English,
4 months ago
Environmental Sciences,
4 months ago
Biology,
11 months ago
Hindi,
11 months ago