code - https://ide.codingblocks.com/s/340220
error -
source.cpp: In function ‘long long int findlastidx(long long int*, long long int, long long int)’:
source.cpp:9:1: warning: control reaches end of non-void function [-Wreturn-type]
9 | }
| ^
Find last element
Hey @guptarahul3100
Line 8 should be
else return findlastidx(a,n-1,m) ;
otherwise u will not be returning anything which is why u are getting this error that control reaches end of function
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.