online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
// Proyecto 3, Calcular nota de alumnos. #include <iostream> using namespace std; int main() { char TERMIN = 'S'; int i = 0, n, j = 0, m = 0, nota[30] = {}, nota_mod[30] = {}, alumn[30] = {}, max = 0, min, sum = 0; float prom = 0; cout << "\t=========== == ===== ============"; cout << "\n\t Calculador de notas estudiantes"; cout << "\n\t=========== == ===== ============"; do { cout << endl << " -Ingrese la cantidad de alumnos que tiene: "; cin >> n; // Se evalua si n es mayor que 30 o menor que 20. if (n < 20 || n > 30) { cerr << endl << " -ESTA CANTIDAD NO ESTA PERMITIDA, INTENTELO DE NUEVO!" << endl; continue; } cout << " -Ingrese las notas de cada alumno. " << endl << endl; for (i = 0; i < n; i++) { cout << " Alumno " << (i + 1) << ": "; cin >> nota[i]; //SUmatoria de las notas. sum += nota[i]; //Promedio del salon. prom = sum / n; // Nota mas alta if (nota[i] >= max) { max = nota[i]; j = i; } } // Evaluacion de la nota minima. min = nota[0]; for (i = 0; i < n; i++) { if (nota[i] <= min) { min = nota[i]; m = i; } } cout << endl << " -La nota mas alta es de " << max << " ptos. Correspondiente al alumno " << (j + 1) << "."; cout << endl << " -La nota minima es de " << min << " ptos. Correspondiente al alumno " << (m + 1) << "."; cout << endl << " -El promedio del salon es de: " << prom; cout << " ptos. Las notas promedios estan entre " << (prom - 1) << " ptos y " << (prom + 1) << " ptos."; cout << endl << " Estas notas son: " << endl << endl; //Mostrara la ronda de promedio. for (i = 0; i < n; i++) { if ( nota[i] <= (prom + 1) && nota[i] >= (prom - 1)) { cout << " Alumno " << (i + 1) << ": " << nota[i] << endl; } } cout << endl << " -Notas para los alumnos inferiores a 6 que entregaron su trabajo." << endl; cout << endl << " -Notas normales. \t-Notas modificadas." << endl; // Nota para los que entregaron el trabajo. for (i = 0; i < n; i++) { if (nota[i] <= 6) { cout << " Alumno " << (i + 1) << ": " << nota[i]; if (nota[i] <= 6) { cout << " \t Alumno " << (i + 1) << ": " << (nota[i] + 1) << endl; } } } cout << endl << endl << " -Desea calcular mas notas de otro salon de clases S/N: "; cin >> TERMIN; } while (TERMIN == 'S' || TERMIN == 's'); 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