1 121 12421 1248421 print these in C programming?

already exists.

Would you like to merge this question into it?

already exists as an alternate of this question.

Would you like to make it the primary and merge this question into it?

exists and is an alternate of .

the series continues with the length of odd series ie.1,3,5,7...so on.the middle integer is extra sdded in every number.it's general structure is
(inital numbers)(extra number)(reverse of initial numbers)

extra number is always multplied by 2 with last extra number added

char s[50];
s[0]=1;
for(i=1;i<n;i++)
{
traverse the array to next middle position
add the extra element in between the elements
concatenate the reverse part of initial elements
}

this can b done as

for(i=1,j=0;i<n;i=strlen(s),j++)
{
for(k=i;k>j;k--)
{
s[k+1]=s[k];
}

s[j+1]=s[j-1]*2;
s[i+3]='\0';
print s;
}
8 people found this useful

1 121 12321 1234321 program?

1^2 = 1 11^2 = 121 111^2 = 12321 1111^2 = 1234321 11111^2 = 123454321 #include #include #include void main() { clrscr(); int n;//soullessgod coutn; int a=1,b,s=1;

How do you print the numbers 1 11 121 1331 14641in pyramid form in c?

include #include #include int count=0; char arr1[20],arr2[20]; int main() { int j; arr1[0]=1; arr1[1]='\0'; int flag=3; for(j=3;j>=-1;j--) printf(" "); printf("1\n"); while(fl

1 121 12421 1248421 print these in php programming?

Assuming you just want those integers printed you can do so likethis: However, if you're looking for how to print these in some sort ofpower of 2 in terms of a homework assi