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) *******************************************************************************/ #include <stdio.h> #include <stdlib.h> //abs library int main() { // Variable declaration int final_grade, grade1, grade2, grade3, grade4; printf("Enter the four grades: "); scanf("%d%d%d%d", &grade1, &grade2, &grade3, &grade4); grade1 = abs(grade1); grade2 = abs(grade2); grade3 = abs(grade3); grade4 = abs(grade4); // Calculate the average final_grade = (grade1 + grade2 + grade3 + grade4) / 4; // Print the final grade printf("Your score is: %d\n", final_grade); // Assign the grade based on the final score if (final_grade >= 90) { printf("You have A\n"); } else if (final_grade >= 80) { printf("You have B\n"); } else if (final_grade >= 70) { printf("You have C\n"); } else if (final_grade >= 60) { printf("You have D\n"); } else { printf("You have F\n"); } 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