online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
/* 1.- Implemente el algoritmo de la burbuja de manera que los elementos ordenados queden de mayor a menor. */ #include <iostream> using namespace std; int main() { int numero[10] = { 2,6,5,4,8,7,9,10,1,3 }, aux = 0, bandera = 0; for (int i = 0; i <= 9; i++) { for (int j = 0; j <= (9 - i); j++) { if (numero[j] > numero[j + 1]) { aux = numero[j]; numero[j] = numero[j + 1]; numero[j + 1] = aux; bandera = 1; } } if (bandera == 0) { i = 9; } else { bandera = 0; } } cout << "-Numeros ordenados de mayor a menor." << endl; for (int i = 9; i >= 0; i--) { cout << numero[i] << " "; } 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