online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
/****************************************************************************** Genesis Ojeda Programa de promedio de notas (validación con valor absoluto) y do while *******************************************************************************/ #include <stdio.h> #include <stdlib.h> //abs library int main() { // Variable declaration int n1, n2, n3, average, student_count, count; char control = 'y'; do { printf("How many students need their average calculation?: "); scanf("%d", &student_count); count = 1; while(count <= student_count) { printf("Enter the three grades of student %d: ", count); scanf("%d %d %d", &n1, &n2, &n3); n1 = abs(n1); n2 = abs(n2); n3 = abs(n3); average = (n1 + n2 + n3) / 3; printf("Your average is: %d\n", average); // Assign the grade based on the final score if (average >= 90) { printf("You have A\n"); } else if (average >= 80) { printf("You have B\n"); } else if (average >= 70) { printf("You have C\n"); } else if (average >= 60) { printf("You have D\n"); } else { printf("You have F\n"); } count = count + 1; } printf("Do you want to restart the program? (y/n): "); scanf(" %c", &control); while (control != 'y' && control != 'n') { printf("Please, enter 'y' or 'n': "); scanf(" %c", &control); } } while (control == 'y'); 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