online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
// Car value program using System; class Program { // ------------------------- // Subprograms // ------------------------- static void show_value(int value, int resale_value) { int year = 0; double depreciation = 0.25; while ((value >= resale_value) && (resale_value > 0)) { Console.WriteLine($"In year {year}, the car is worth £{value}"); value = Convert.ToInt32(value - (value * depreciation)); year = year + 1; } Console.WriteLine($"Part exchange before end of year {year}"); } // ------------------------- // Main program // ------------------------- static void Main() { Console.Write("Enter the value of the car purchased: £"); int value = Convert.ToInt32(Console.ReadLine()); Console.Write("Enter the minimum part exchange value: £"); int resale_value = Convert.ToInt32(Console.ReadLine()); show_value(value, resale_value); } }

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