online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <stdio.h> int main() { float gallons; float miles; float mileage; float totalmiles = 0; float totalgallons = 0; printf("Enter the gallons used (-1 to end): "); scanf("%f", &gallons); while (gallons != -1) { printf("Enter the miles driven: "); scanf("%f", &miles); mileage = miles / gallons; printf("The miles/gallon for this tank was %f\n\n", mileage); totalmiles = totalmiles + miles; totalgallons = totalgallons + gallons; printf("Enter the gallons used (-1 to end): "); scanf("%f", &gallons); } printf("\nThe overall average miles/gallon was %f\n", (totalmiles/totalgallons)); 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