write a program to display the numbers in the following
format
4 4
3 3 3 3
2 2 2 2 2 2
1 1 1 1 1 1 1 1
0 0 0 0 0 0 0 0 0
1 1 1 1 1 1 1
2 2 2 2 2
3 3 3
4
Answer Posted / mahesh
#include<stdio.h>
int main()
{
int a=2,n=4,i,j,k;
for (i=4;i>=0;i--)
{
for(j=0;j<a;j++)
{
printf("%d",n);
}
printf("
");
a=a+2;
n--;
}
n=1;
a=a-4;
for(i=0;i<=4;i++)
{
for(j=0;j<a;j++)
{
printf("%d",n);
}
printf("
");
a=a-2;
n++;
}
}
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
Is python a c language?
Can you tell me how to check whether a linked list is circular?
What is void c?
How can you avoid including a header more than once?
Explain how are portions of a program disabled in demo versions?
Why does this code crash?
What is break in c?
What is 1d array in c?
Which function in C can be used to append a string to another string?
What are enums in c?
When should a type cast be used?
What is console in c language?
What are the advantages of using linked list for tree construction?
Explain why C language is procedural?
Why we write conio h in c?