online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <cstdlib> #include <iostream> #define maxf 5 using namespace std; int main(){ int opcion, f, j, k, l=0, m=0, min, max, sum=0, sum1=0; int A[maxf]; // leer A = [15; 11; 25; 91; 2; 13; 9; 8; 17; 81; 52; 6; 47; 3; 81] cout<<"Ingrese "<<maxf<<" valores de Arreglo:"<<endl; for(f=0; f<maxf; f++) cin>>A[f]; cout<<"Introduzca opcion"<<endl; cout<<"1)valor minimo"<<endl; cout<<"2)valor maximo"<<endl; cout<<"3)valor promedio"<<endl; cout<<"4)suma de valores"<< endl; cin>>opcion; switch (opcion) { case 1: min=A[0]; for(j=1; j<maxf; j++) if(A[j] <= min) min=A[j]; cout<<"Mínimo es: "<<min<<endl; break; case 2: max=A[0]; for(k=1; k<maxf; k++) if(A[k] >= max) max=A[k]; cout<<"Máximo es: "<<max<<endl; break; case 3: while(l<maxf){ sum+=A[l];l=l+1;} cout<<"Promedio es: "<<(float)sum/maxf<<endl; break; default: while(m<maxf) sum1+=A[m];m=m+1; cout<<"Suma es: "<<sum1<<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