From bc5f2be743bd4f2e3c14ebdae37d5a342ecf8fef Mon Sep 17 00:00:00 2001 From: Ruchika Date: Wed, 14 Oct 2020 14:53:58 +0530 Subject: [PATCH] added cpp code for fibonacci --- code/C++/fibonacci.cpp | 16 ++++++++++++++++ code/addInfo.json | 6 +++--- 2 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 code/C++/fibonacci.cpp diff --git a/code/C++/fibonacci.cpp b/code/C++/fibonacci.cpp new file mode 100644 index 0000000..182830d --- /dev/null +++ b/code/C++/fibonacci.cpp @@ -0,0 +1,16 @@ +#include +using namespace std; + +int main() +{ + int n; + cin>>n; + int sum_ar[n]; + sum_ar[0]=1; + sum_ar[1]=1; + for(int i=2;i