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
Explain what is wrong with this program statement?
How to check whether string is a palindrome, WITHOUT USING STRING FUNCTIONS?
FILE PROGRAMMING
why arguments can generally be passed to functions a) sending the values of the arguments b) sending the addresses of the arguments c) a & b d) none of the above
What are predefined functions in c?
Which programming language is best for getting job 2020?
What is a node in c?
what will be maximum number of comparisons when number of elements are given?
Explain how do you determine whether to use a stream function or a low-level function?
What do you mean by command line argument?
What is calloc in c?
What do you understand by normalization of pointers?
what is the difference between north western polytechnique university and your applied colleges?? please give ur answers for this. :)
What are identifiers and keywords in c?
What is the use of a conditional inclusion statement in C?