online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
int peak(int a[],int n){ int s=0; int e=n-1; while(s<=e){ int m = (s+e)/2; if(m==0 && a[m]>=a[m+1]){ //cout<<m<<"a"<<"\n"; cout<<m<<"\n"; return m; } else if(m==n-1 && a[m]>=a[m-1]){ //cout<<m<<"b"<<"\n"; cout<<m<<"\n"; return m; } else if(a[m]>=a[m+1]&&a[m]<=a[m-1]){ //cout<<m<<"c"<<"\n"; cout<<m<<"\n"; return m; } else if(a[m+1]>a[m]){ s=m+1; } else if(a[m-1]>a[m]){ e=m-1; } } } // arr: input array // n: size of array int peakElement(int arr[], int n) { // Your code here peak(arr,n); }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue