I am starting to learn c++. So I want to try this using only recursion.Thank You for your help.

```
#include <iostream>

using namespace std;

int lastIndex(int arr[], int size, int num){
    size--;
    if(size < 0)return -1;
    if(arr[size] == num)return size;
    return(arr, size, num);
}

int main(){
    int arr[11] = {1, 2, 2, 4, 2, 8};
    cout << "Last Index = " << lastIndex(arr, 6, 2);
}

```