language is c++
2. [50 points] Write a function that calculates Fibonacci numbers from 1 to 40, xn, n- 1,2,…40: rl For example:X2-X1 + Xo = 1 + 0 = 1. Show transcribed image text 2. [50 points] Write a function that calculates Fibonacci numbers from 1 to 40, xn, n- 1,2,…40: rl For example:X2-X1 + Xo = 1 + 0 = 1.
Answer
#include <iostream>
using namespace std;
void fibCalculation()
{
for(int n=0;n<=40;n++)//this loop indicate n
OR
OR