For this Question: Fibonacci numbers are interesting but Tribonacci numbers are more interesting.
A Tribonacci number T(n) is the sum of the preceding three elements in a series. Consider its first three numbers to be 0, 0, and 1. i. e T(1) = 0, T(2) = 0, T(3) = 1. 
Given a number N, your task is to return the nth Tribonacci number.The input contains a single integer N.

Constraints:-
1 <= N <= 20Return the Nth Tribonacci number.Sample Input:-
4

Sample Output:-
1

Sample Input:-
7

Sample Output:-
7, I have written this Solution Code: #include <bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin>>n;
    int a[4];
    a[0]=0;
    a[1]=0;
    a[2]=1;
    if(n<=3){
        cout<<a[n-1];
        return 0;
    }
    for(int i=0;i<n-3;i++){
        a[3]=a[0]+a[1]+a[2];
        for(int j=0;j<3;j++){
            a[j]=a[j+1];
        }
        //cout<<a[2]<<endl;
    }
    cout<<a[2];
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?