online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
using System; class HelloWorld { static void Main() { string[] tab = { "komp-2010", "lap-2019", "ps-2014", "xbox-2018", "pralka-2020", "lodowka-2021" }; for(int i=0; i<tab.Length; i++) { string[] subs = tab[i].Split('-'); Console.WriteLine($"Dla produktu: {subs[0]}"); int span = DateTime.Now.Year - Convert.ToDateTime($"1/1/{subs[1]}").Year; string year_pl = (span <= 1) ? ((span == 0) ? "nie uplynol jeszcze rok" : "uplynol rok") : (span < 5) ? $"uplynely {span} lata" : $"uplynelo {span} lat"; Console.WriteLine($"Od daty zakupu {year_pl}\n"); } Console.ReadLine(); } }

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