Question
Complete the given code to print following series: 1, 1, 2, 3, 5, 8
int a=0, b=1, c;
while(a <= 8) {
c = a + b;
cout << a;
a = b;
b = c;
}
Complete the given code to print following series: 1, 1, 2, 3, 5, 8
int a=0, b=1, c;
while(a <= 8) {
c = a + b;
cout << a;
a = b;
b = c;
}
Sign in to write or photograph your own answer before checking the model answer. It is saved privately to your account and free to do.
Flashcards, MCQs and other questions linked to this one appear here as they are added.
Topics and outcomes this question is testing.