diff --git a/Pattern/Pattern_Matching_Fibonacci_Series.cpp b/Pattern/Pattern_Matching_Fibonacci_Series.cpp new file mode 100644 index 0000000..f4286a0 --- /dev/null +++ b/Pattern/Pattern_Matching_Fibonacci_Series.cpp @@ -0,0 +1,17 @@ +#include +using namespace std; + +int main (){ + int n; + cout<<"Enter the value of n : "; + cin>>n; + int a= 0; + int b =1; + cout << a<< " " << b << " "; + for (int i=3; i<=n ; i++){ + int next_num = a+b; + cout << next_num << " "; + a=b; + b= next_num; + } +}