What is the error in this code

n this code
#include using namespace std; int findmax(int ptr,int n) { int i,max=(ptr); for(i=0;i<n;i++) { if(max<(ptr+i)) max=(ptr+i); } delete []ptr; return max; } int main() { int n; cout<<“enter the no. of items”<<endl; cin>>n; int *ptr=new int[n]; int temp,i; cout<<“enter elements” for(i=0;i<n;i++) { cin>>temp; *(ptr+i)=temp; } int item=findmax(ptr,n); cout<<“max value”<<item; return 0; }
:bulb: Arrays-Max Value In Array

@hs9177222 Save your code on ide.codingblocks.com and share its link. It is easy to debug in that case.

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.