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 ?    7 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the advantages and disadvantages of macros.

1145


What does. int *x[](); means ?

1139


What is the need of structure in c?

1190


What is typedf?

1169


Is c language still used?

1045


Explain how many levels deep can include files be nested?

1124


An integer that indentifies the position of a data item in a sequence of data items a) value b) number c) index d) all of the above

1267


Explain what is wrong with this program statement? Void = 10;

1313


Discuss the function of conditional operator, size of operator and comma operator with examples.

1216


Do pointers take up memory?

1216


What is the difference between a function and a method in c?

1135


What are global variables?

1269


Is c is a procedural language?

1133


Explain the ternary tree?

1080


What is c basic?

1228