Write the complete function f2() which uses a recursive approach to perform the function f1() does.
int f2 ( int a[], int size, int current, int key)
{
// Your code for the answer should be inserted here.
}
#include <iostream>
using namespace std;
int f1 ( int a[], int size, int key)
{
int count = 0;
for ( int i = 0 ; i < size ; i++ )
{
if ( a[i] < key )
{
cout << a[i] << "/";
count++;
}
}
return count;
}
int main()
{
int result;
int a[4] = {6,8,7,3};
result = f1(a,4,7);
cout << endl;
cout << result << endl;
}