answersLogoWhite

0


Best Answer

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<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.

}

}

User Avatar

Wiki User

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

Wiki User

15y ago

for (i=0; i<1; ++i) puts ("1123581321");

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

for (i=0; i<1; ++i) puts ("1 232 34543 5678765");

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

#include int main (void) { int i; for (i=0;i<1;++i) puts ("1 121 12321 1234321"); return }

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a c program to print 1 232 34543 5678765 using for loop?
Write your answer...
Submit
Still have questions?
magnify glass
imp