Code:

int helpProper(int arr[],int length,int index,int j,int k,int longest){
if (index<length){
if (arr[index]==0||arr[index]==1){
if (arr[index]>longest)
longest=arr[index];
return (helpProper(arr,length,index+1,index+2,index+3,longest));
}
if (k>=length)
return (helpProper(arr,length,index+1,index+2,index+3,longest));
if (arr[index]==arr[j]+arr[k]){
if (arr[index]>longest)
temp=index;
return (helpProper(arr,length,j,j+1,j+2,longest));
return (helpProper(arr,length,k,k+1,k+2,longest));
longest=arr[index];
return (helpProper(arr,length,temp+1,index+2,index+3,longest));
}
if (arr[j]<arr[index])
return(helpProper(arr,length,index,j,k+1,longest));
return (helpProper(arr,length,index,j+1,k+1,longest));
}
return longest;
int biggestProper(int arr[],int length,int index){
return helpProper(arr,length,index,1,2,-1);
void main{
printf ("Enter the length:\n");
scanf("%d",&length);
printf("Enter the array:\n");
input(arr,length,0);
printf("Output:\n");
printf("%d\n\n",biggestProper(arr,length,0))
};