online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <iostream> #include <cstdlib> #include <time.h> #define n 3 using namespace std; int main(){ srand(time(NULL)); int A[n][n], B[n*n], i, j, numVeces, aux, contador=0; cout<<"Matriz 2D: "<<endl; for(i=0; i<n; i++) for(j=0; j<n; j++) A[i][j] = rand(); for(i=0; i<n; i++) for(j=0; j<n; j++) cout << A[i] [j] << " "; cout<<endl; for(i=0; i<n; i++) for(j=0; j<n; j++) B[i*n+j] = A[i][j]; for (numVeces=1; numVeces<n*n; numVeces++) for (i=0; i<n*n-1; i++) if (B[i] > B[i+1]) { aux=B[i]; B[i] = B[i+1]; B[i+1] = aux; } for(i=0; i<n*n; i++) if ( B[2] == B[i]){ contador ++; } cout<<"\n\nEl tercer valor mas bajo de la matriz es: "<<B[2]<<" y se repite "<<(contador-1)<<" veces"<<endl; 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