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; int main(){ srand(time(NULL)); int i,n,a=1,b=10,c; float media; cout << "ingrese numero de elementos: " << endl; cin >> n; c=(rand()%(b-a+1)+a); media=(float)c; cout << " " << c << " "; if (n>1){ for ( i = 2; i <= n; i++){ c= (rand()%(b-a+1)+a); cout << " " << c << " "; media = media*((float)(i-1)/(float)i) + ((float)(c)/(float)i); } } cout << " " << media << 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