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

Hello. How to write a C program to check and display president party like if i type in the console "biden" and hit enter the output shoud be : "biden is democrat" and if i type "trump" and hit enter the output shoud be: "trump is republican"

2064


Which is not valid in C a) class aClass{public:int x;}; b) /* A comment */ c) char x=12;

1058


What is header file definition?

1073


What are the application of c?

1086


What is the difference between NULL and NUL?

1279


Explain what is a stream?

1074


What are the applications of c language?

1061


What do you mean by c what are the main characteristics of c language?

1029


What is NULL pointer?

1081


int far *near * p; means

3541


write a sorting prgm to sort 50 nos and sum them and also remove all the occurrences of 15 and print it?

2124


What are multibyte characters?

1098


Why enum is used in c?

939


int main() { Int n=20,i; For(i=0;i<=n;i--) { Printf(“-“); Return 0;

1809


what is different between auto and local static? why should we use local static?

1116