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 / ayas kumar das

#include"stdio.h"
int main()
{
int i,j,n;
printf("enter the number :");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=1;j<=i;j++)
{
printf("%d",j);
}
if(i>1)
{
for(j=i;j>1;)
{
printf("%d",j-1);
j=j-1;
}
}
printf("\n");
}
return 0;
}

Is This Answer Correct ?    12 Yes 20 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to compare array with pointer in c?

1073


printf(), scanf() these are a) library functions b) userdefined functions c) system functions d) they are not functions

1120


What are the restrictions of a modulus operator?

1084


How does placing some code lines between the comment symbol help in debugging the code?

963


What is enumerated data type in c?

1048


Describe the order of precedence with regards to operators in C.

1021


What is void pointers in c?

973


What are variables c?

1010


What is structure padding in c?

1086


Explain what math functions are available for integers? For floating point?

1082


What is return in c programming?

939


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

1041


What is a c token and types of c tokens?

1029


FORMATTED INPUT/OUTPUT functions are a) scanf() and printf() b) gets() and puts() c) getchar() and putchar() d) all the above

1081


What is a program flowchart?

1148