fibonssi number in cpp

technical talkiess
0

 // Online C++ compiler to run C++ program online

#include <iostream>

using namespace std;

int main() {

   int i = 10;

   int a = 0;

   int b = 1;

   cout << a << " " << b << " ";

   for(int k =1 ; k<=i;k++){

       int value = a+b;

       cout<<value<<" ";

       a=b;

       b=value;

   }


    return 0;

}

Tags

Post a Comment

0Comments

Thanks you for commenting your questions. I will see question and respond you.

Post a Comment (0)