Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

write a pgm to print
1
1 2 1
1 2 3 2 1
1 2 3 4 3 2 1

Answer Posted / nisrar

void main()
{
int i,j,k,m;
for(i=1;i<=4;i++)
{
for(j=4;j>i;j--)
{
printf(" ");
}
for(k=1;k<=i;k++)
{
printf("%d",k);
}
for(m=i;m>1;m--)
{
printf("%d",m-1);
}
printf("\n");
}
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?

1149


Can I use base-2 constants (something like 0b101010)? Is there a printf format for binary?

1064


Explain #pragma statements.

1100


Explain what is the stack?

1161


How do I determine whether a character is numeric, alphabetic, and so on?

1186


What are the keywords in c?

1177


What is the use of typedef in structure in c?

1008


what is a NULL Pointer? Whether it is same as an uninitialized pointer?

1331


What is the purpose of macro in C language?

1164


Explain why can’t constant values be used to define an array’s initial size?

1402


What is strcmp in c?

1219


explain what is fifo?

1135


What is advantage of pointer in c?

1247


exit () is used to a) exit () terminates the execution of the program itself b) exit () terminates the execution of the loop c) exit () terminates the execution of the block d) none of the above

1182


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

1176