online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <stdio.h> #include <string.h> #include <math.h> #include <stdlib.h> void bubbleSort(int A[], int n){ for(int i=0; i<(n-1);i++){ for(int j=i+1;j<n;j++){ if(A[j]<A[i]){ int h=A[i]; A[i]=A[j]; A[j]=h; } } }} void sortAlter(int A[],int n){ int mid; if(n%2!=0){ mid=(n/2)+1; } else mid=(n/2); bubbleSort(A,mid); for(int i=0; i<mid; i++) printf("%d ",A[i]); bubbleSort(A,mid); for(int j=n-1; j>=mid; j--) printf("%d ",A[j]); } int main() { int n; scanf("%d",&n); int A[n]; for(int i=0;i<n;i++) scanf("%d",&A[i]); sortAlter(A,n); return 0; }

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