Answer to Question #305247 in C++ for Batoo

Question #305247

Write a c++ program to display the Fibonacci series of the first 50 integer

1
Expert's answer
2022-03-03T14:34:00-0500
#include <iostream>

using namespace std;

int main() {
  int fib[100];
  fib[0] = 0;
  fin[1] = 1;
  for (int i = 2; i <= 50; i++) {
    fib[i] = fib[i-2] + fib[i-1];
  }
  cout << fib[50] << endl;
  return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog