answersLogoWhite

0

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

14y ago

What else can I help you with?