online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
// Implementacion recursiva de Bubble sort #include <iostream> using namespace std; // Funcion que implementa bubble sort void bubbleSort(int arr[], int n) { // Caso Base if (n == 1) return; // Un recorrido de bubble sort. // Como resultado el elemento mas grande // es movido al final. for (int i=0; i<n-1; i++) if (arr[i] > arr[i+1]) swap(arr[i], arr[i+1]); // El elemento mas grande es fijado, // Llamada recursiva para el resto del arreglo bubbleSort(arr, n-1); } /* Funcion para imprimir un arreglo */ void printArray(int arr[], int n) { for (int i=0; i < n; i++) cout << arr[i] << endl; } // Programa para probar las funciones anteriores int main() { int arr[] = {64, 34, 25, 12, 22, 11, 90}; int n = sizeof(arr)/sizeof(arr[0]); bubbleSort(arr, n); cout << "Arreglo Ordenado : \n" << endl; printArray(arr, 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