answersLogoWhite

0


Best Answer

1^2 = 1
11^2 = 121
111^2 = 12321
1111^2 = 1234321
11111^2 = 123454321













#include
#include
#include
void main()
{
clrscr(); int n;//soullessgod
cout<<"\n enter number of lines ";//whatsoever
cin>>n;
int a=1,b,s=1;
for(;a<=n;s=s*10+1)
{
for(b=n-a;b>=1;b--)
{
cout<<" ";
}
cout<cout<<"\n";
a++;
}

getch();
}

User Avatar

Wiki User

15y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

11y ago

for(int r=1; r<=5; r++)

{

for(int sp=5-r; sp>0; sp--)

System.out.print(" ");

for(int c=r; c>=1; c--)

System.out.print(c);

for(int c=2; c<=r; c++)

System.out.print(c);

System.out.print("\n");

}

for(int r=1; r<=5; r++)

{

for(int sp=r; sp>=1; sp--)

System.out.print(" ");

for(int c=5-r; c>=1; c--)

System.out.print(c);

for(int c=2; c<=5-r; c++)

System.out.print(c);

System.out.print("\n");

}

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

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;

}

This answer is:
User Avatar

User Avatar

Wiki User

15y ago

#include <stdio.h>

int main (void)

{

puts ("12345 51234");

return 0;

}

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: 1 121 12321 1234321 program
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Write a c program to print the following pyramid 1 121 1231 12321 1234321?

123454321


What is the code in c plus plus which gives output 1 121 12321 1234321?

#include &lt;iostream&gt; int main() { std::cout &lt;&lt; "1 121 12321 1234321" &lt;&lt; std::endl; return 0; }


What is C program pattern 12321 121 1?

/*determine the pattern 1234321*/ #include&lt;stdio.h&gt; #include&lt;conio.h&gt; main() { int i, j; for (i=1; i&lt;=7; i++) { if (i&lt;5) { j=i; printf("\n %d", j); } else { j=8-i; printf("\n %d", j); } } getch() }


What is the magic 11 trick?

1x1=1 11x11=121 111x111=12321 1111x1111=1234321 11111x11111=123454321 There is another 11 trick. 11 *11 ok so you always put the 11 on top. Then the number on the bottom. The first digit goes on the left. then leave a space for the middle number. Then the second digit and put it in the right spot. Then add those together and put that numbe rinto the middle spot! ----- 121


What are the release dates for As the World Turns - 1956 1-12321?

As the World Turns - 1956 1-12321 was released on: USA: 10 August 2004


What is 111111111times 111111111?

111111111 x 111111111 = 12'345.6789876, "Hope that helps." you can get the square of any number which contain only 1, like: 11 or 11111111 with the thrick below, &amp; of course there would be no need for any kinda calculator. 11*11=121 111*111=12321 1111*1111=1234321 got it ? just count how many times 1 has been repeated in the number, for instance in the last case it's been repeated 4 times. then simply write 1 2 3 4 3 2 1. this cutoff has no limitation in frequency of 1 in the number. &amp; Done.


What is the factor for 121?

The factors of 121 are 1&bull;121 and 11&bull;11 :)


What is the interest on a 10000 for 2 year at 11 percent note?

Total = 10000(1+i)n Total = 10000(1.2321)2 Total = 12321 Change = interest gained = 12321 - 10000 = 2321


How do you print 1 121 1331 14641 in c?

#include#includevoid main(){clrscr();for (int i=1;i


Write a c program to print 1 232 34543 5678765 using for loop?

If you visualize 1123581321 as a set of numbers (without spaces in between) instead of one number, you'll see that it's a set of the first 8 Fibnocci nos. - 1 1 2 3 5 8 13 21. The following program would print the required no. using a For looping structure. int main (void) { int i=1; int j=1; int k, num=1; for(k=0; k&lt;7; k++){ if(k==0){ printf("%d", num); } printf("%d", num); //next no. is the sum of previous two nos. in the series i=j; j=num; num=i+j; // 1 + 1 = 2 ... 1 + 2 = 3 ... 2 + 3 = 5 ... 3 + 5 = 8 // sum=i + j ... i takes value of j ... j takes value of sum ... repeat. } }


What are all the factors of 121?

1, 11 and 121


What two numbers go into -121?

1, 11, 121, -1, -11, -121