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


Please Help Members By Posting Answers For Below Questions

Where are local variables stored in c?

556


What is meant by inheritance?

616


`write a program to display the recomended action depends on a color of trafic light using nested if statments

1620


What does the c preprocessor do?

605


a parameter passed between a calling program and a called program a) variable b) constant c) argument d) all of the above

638






Hai what is the different types of versions and their differences

1476


what is bit rate & baud rate? plz give wave forms

1499


What does %d do in c?

530


How old is c programming language?

561


What are global variables?

630


What is the scope of an external variable in c?

552


What is the scope of global variable in c?

543


What are the basic data types associated with c?

797


I heard that you have to include stdio.h before calling printf. Why?

576


What is pragma c?

599