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 program in c to print
1
121
12321
1234321
123454321

Answer Posted / arun c s

#include <stdio.h>
main()
{
int i, j, k, space, n=9;

for (i=1; i<=n; i++)
{
for (j=1; j<=n-i; j++)
putchar(' ');
for (j=1,k=2*i-1; j<=2*i-1; j++,k--)
{
if (j <= k)
printf("%d", j);
else
printf("%d", k);
}
putchar('
');
}

getch();
}

Is This Answer Correct ?    4 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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

1386


write a program to print largest number of each row of a 2D array

2328


What are register variables? What are the advantage of using register variables?

1191


what is use of malloc and calloc?

1910


Why do we use pointer to pointer in c?

1091


Where does the name "C" come from, anyway?

1175


Using functions, write a program that multiplies two arrays. Use the following functions: - Function ReadArray - Function MultiplyArrays - Function DisplayArrays

2364


What are header files and explain what are its uses in c programming?

1135


Write a program to use switch statement.

1136


hw can we delete an internal node of binary search tree the internal node has child node..plz write progarm

2026


What are structural members?

1019


Can we change the value of #define in c?

1001


how much salary u want ? why u join in our company? your domain is core sector why u prefer software ?

1992


What is 1f in c?

2668


What is volatile variable how do you declare it?

1105