isSorted question error

why isnt it working
#include
using namespace std;

bool isSorted(int *arr, int n){
if(n==1||n==0){
return true;
}

bool smallAns=isSorted(arr+1,n-1);

if((arr[0]<arr[1])&&(smallAns)){ return true;}
else{return false;}

}
int main() {

int n;
int arr[n];
for(int i=0;i<n;i++){
	cin>>arr[i];
}

if(isSorted(arr,n)==1){cout<<"true";}
else{cout<<"false";}
return 0;

}

hi @discobot send the code on ide.codingblocks.com
write, save and send the url of the page

Hi! To find out what I can do, say @discobot display help.