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
What are run-time errors?
What is the difference between union and structure in c?
What are the advantages of using linked list for tree construction?
What are the advantages of union?
What is the difference between single charater constant and string constant?
What are the different types of endless loops?
Why c is called object oriented language?
What is static function in c?
What does volatile do?
Explain what are header files and explain what are its uses in c programming?
What are all different types of pointers in c?
Can include files be nested?
can any one provide me the notes of data structure for ignou cs-62 paper
Explain about block scope in c?
What are directives in c?