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 for the following series?

1
121
12321
1234321
123454321
12345654321
1234567654321
123456787654321
12345678987654321
1234567890987654321
123456789010987654321
12345678901210987654321
1234567890123210987654321
.........1234321............
..........123454321............
..........12345654321............
7
8
9
0
1
Pls............?

Answer Posted / eranna

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

printf("Enter no.of lines :");
scanf("%d",&n);

for(i=1;i<=n;i++)
{
printf("\t");
for(j=1;j<=n-i;j++)
printf(" ");
for(j=1;j<=i;j++)
printf("%d",j);

for(k=j-2;k>0;k--)
printf("%d",k);

printf("\n");
}


}

Is This Answer Correct ?    13 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to get string length of given string in c?

1008


Explain can static variables be declared in a header file?

1103


What is the difference between pure virtual function and virtual function?

1066


What is the use of parallelize in spark?

975


What are different types of variables in c?

1008


What is memory leak in c?

1061


What does node * mean?

1142


What is difference between function overloading and operator overloading?

1045


hi send me sample aptitude papers of cts?

2105


What is the c language function prototype?

1041


what are non standard function in c

1848


Explain what is the difference between the expression '++a' and 'a++'?

1152


Explain argument and its types.

992


What is the deal on sprintf_s return value?

1066


Do pointers need to be initialized?

1017