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 / vignesh1988i

#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k,a,n,s,p;
clrscr();
printf("enter the no. of lines :");
scanf("%d",&n);
a=n;
j=1;
for(i=1;i<=n;i++)
{
for(k=1;k<=(a-1);k++)
printf(" ");
a--;
for(k=1,p=1;k<=(i-1);)
{
if(!((k%10)^0))
p=0;
printf(%d",p);
k++; p++;
}
if(!((i%10)^0)
j=0;
printf("%d",j);
j++;
s=--p;
if(i>10)
{
for(;s>=0;s--)
printf("%d",s);
s=i-(p+1)-1;
}
for(;s>0;s--)
printf("%d",s);
printf("\n");
}
getch();
}


thank u , hope this works

Is This Answer Correct ?    9 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we assign integer value to char in c?

1160


What are the types of operators in c?

1006


What is the code in while loop that returns the output of given code?

1900


Which is better malloc or calloc?

1060


why wipro wase

2252


What is the difference between printf and scanf in c?

1287


Explain do array subscripts always start with zero?

1177


Explain Basic concepts of C language?

1084


Explain how can I convert a string to a number?

1029


There is a practice in coding to keep some code blocks in comment symbols than delete it when debugging. How this affect when debugging?

1245


What does #pragma once mean?

1112


How does struct work in c?

1033


What is the use of static variable in c?

1046


c programs are converted into machine language with the help of a) an interpreter b) a compiler c) an operatinf system d) none of the above

1207


How do you override a defined macro?

1210