online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <iostream> #include <cstdlib> #include <time.h> #define L 20 using namespace std; int main(){ srand(time(NULL)); int A[L]; //int A[L] = {15, 11, 25, 91, 2, 13, 9, 8, 17, 81, 52, 6, 47, 91, 81}; //int B[L]; int i, j, a=10, b=99, numVeces, aux; cout << "\n datos no ordenados: " << endl; for (j=0; j<L; j++) { A[j] = rand()%(b-a+1)+a; cout << A[j] << " "; } for (numVeces=1;numVeces<=L-1;numVeces++) { for (i=0; i<=L-2; i++) { if (A[i] > A[i-1]) { aux=A[i]; A[i] = A[i+1]; A[i+1] = aux; } } } for (i=0; i<=L-1; i++) { if (A[i] == A[i-1]) { A[i] = rand()%(b-a+1)+a; } } cout << "\n\n datos sin numeros repetidos: " << endl; for (i=0;i<=L-1;i++) { cout << A[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