online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <iostream> #include <cstdlib> #include <time.h> using namespace std; float media(int n); // https://es.wikipedia.org/wiki/Algoritmos_para_calcular_la_varianza int main(){ srand(time(NULL)); int n; cout << "ingrese numero de elementos: " << endl; cin >> n; cout << media(n) << endl; return 0; } float media(int n){ int b=10,a=1,c; if(n==1){ c= (rand()%(b-a+1)+a); cout << " " << c << " "; return (float)(c); }else{ c= (rand()%(b-a+1)+a); cout << " " << c << " "; return media(n-1)*((float)(n-1)/(float)n)+((float)(c)/(float)n); } }

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