Search
 
SCRIPT & CODE EXAMPLE
 

CPP

C++ fibo

#include <iostream>
using namespace std;

long long c=0;
int fib(int a){
    if(a==1||a==2){
        return 1;
    }
    return fib(a-1)+fib(a-2);
}

int main(){
    cout << fib(6);
}

//8
Comment

PREVIOUS NEXT
Code Example
Cpp :: Chocolate Monger codechef solution in c++ 
Cpp :: C++ program for Celsius to Fahrenheit and Fahrenheit to Celsius conversion using class 
Cpp :: oncomponentendoverlap ue4 c++ 
Cpp :: Syntax for C++ Operator Overloading 
Cpp :: glm has no member value_ptr 
Cpp :: string erase 
Cpp :: program to swap max and min in matrix 
Cpp :: printing in column c++ 
Cpp :: copy constructor c++ syntax 
Cpp :: function c++ example 
Cpp :: three way comparison operator c++ 
Cpp :: Euler constant 
Cpp :: variadic template in c++ 
Cpp :: c++ stl vector get iterator from index 
Cpp :: if else in c++ 
Cpp :: pow without math.h 
Cpp :: loops in c and c ++ 
Cpp :: pointers c++ 
Cpp :: concatenate string in cpp 
Cpp :: C++ Taking Multiple Inputs 
Cpp :: split text c++ 
Cpp :: even and odd numbers 1 to 100 
Cpp :: c++ constructor 
Cpp :: how to show constellations in starry night orion special edition 
Cpp :: C+++++++++++++++++++++++++++ JAVA 
Cpp :: error: use of parameter outside function body before ] token c++ 
Cpp :: uint16_t does not name a type 
Cpp :: #include <iostream #include <stdio.h using namespace std; int main() { int a[5]; a[0]=12; a[1]=13; a[2]=14; a[3]=15; 
Cpp :: true false operator 
Cpp :: class how to call main method inheritance in c++ 
ADD CONTENT
Topic
Content
Source link
Name
1+5 =