online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <iostream> #include <cstdlib> #include <time.h> #define k 500 using namespace std; int Dado(int a, int b); int main(){ srand(time(NULL)); int sumaDadoSimulacion[k]; int Dados[k][2]; int i, j, l; float propAux, propAux2, propAux3; //int Dado1 = Dado(1,6); //int Dado2 = Dado(1,6); for (j=0; j<k; j++){ sumaDadoSimulacion[j] = Dado(1,6)+Dado(1,6); } propAux=0; for (i = 0; i<k; i ++){ if(sumaDadoSimulacion[i] == 7) propAux = propAux+1; } // PARA LA b) for (j=0; j<k; j++){ for (l=0; l<2; l++){ Dados[j][l] = Dado(1,6); } } propAux = 2; for (i = 0; i<k; i ++){ if(Dados[i][0] == Dados[i][1]) propAux2 = propAux2+1; } // PARA LA c) propAux3=0; for (i = 0; i<k; i ++){ if(Dados[i][0] == 1 || Dados[i][1]==5) propAux3 = propAux3+1; } /*for (i = 0; i<3; i ++){ cout<<"("<<Dados[k][0]<<", "<<Dados[k][1]<<"); "<<endl; }*/ cout<<"a)proporcion de 7 es: "<<propAux/(float)k<<endl; cout<<"b)proporcion de iguladad de dados es: "<<propAux2/(float)k<<endl; cout<<"c)proporcion de el par 1 y 5 es: "<<propAux3/(float)k<<endl; return 0; } int Dado(int a, int b) { return rand()%(b-a+1)+a; }

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