online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <stdio.h> int main(void) { double amount; float bal; int loonies, quarters, dimes, nickels, pennies; float gst; printf("Please enter the amount to be paid: $"); scanf("%lf", &amount); //GST gst = (amount * 0.13) + 0.005; amount = amount + gst; printf("GST: %.2lf\n", gst); printf("Balance owing: $%.2lf\n", amount); //Loonies loonies = amount; bal = (amount - loonies); printf("Loonies required: %d, balance owing $%.2lf\n", loonies, bal); //Quarters quarters = ((bal * 100) / 25); bal = bal - (quarters*.25); printf("Quarters required: %d, balance owing $%.2lf\n", quarters, bal); //Dimes dimes = (int)(((int)(100 * bal)) / 10); bal = bal - (dimes*.10); printf("Dimes Required: %d, balance owing %.2f$ \n", dimes, bal); //Nickels nickels = (int)(((int)(100 * bal)) / 5); bal = bal - (nickels*.05); printf("Nickels required: %d, balance owing $%.2lf\n", nickels, bal); //Pennies pennies = (int)(((int)(100 * bal)) / 1) + 1; bal = (bal - (pennies*.01)); printf("Pennies required: %d, balance owing %.2f$", pennies, bal); 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