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 output redirection?
which is conditional construct a) if statement b) switch statement c) while/for d) goto
a program that can input number of records and can view it again the record
What is c value paradox explain?
What are the header files used in c language?
What is the significance of an algorithm to C programming?
Explain what are global variables and explain how do you declare them?
What is volatile keyword in c?
What are keywords in c with examples?
What is a ternary operator in c?
What are the similarities between c and c++?
How many keywords (reserve words) are in c?
What is variable declaration and definition in c?
What is difference between union and structure in c?
Can you explain what keyboard debouncing is, and where and why we us it? please give some examples