fork download
  1. using static System.Console;
  2.  
  3. public class Program {
  4. public static void Main() {
  5. for (int i = 1; i >= 0; i *= 2) { WriteLine($"i: {i}"); }
  6. checked {
  7. for (int j = 1; j >= 0; j *= 2) { WriteLine($"j: {j}"); }
  8. }
  9. }
  10. }
  11.  
  12. //https://pt.stackoverflow.com/q/326539/101
Runtime error #stdin #stdout #stderr 0.02s 15944KB
stdin
Standard input is empty
stdout
i: 1
i: 2
i: 4
i: 8
i: 16
i: 32
i: 64
i: 128
i: 256
i: 512
i: 1024
i: 2048
i: 4096
i: 8192
i: 16384
i: 32768
i: 65536
i: 131072
i: 262144
i: 524288
i: 1048576
i: 2097152
i: 4194304
i: 8388608
i: 16777216
i: 33554432
i: 67108864
i: 134217728
i: 268435456
i: 536870912
i: 1073741824
j: 1
j: 2
j: 4
j: 8
j: 16
j: 32
j: 64
j: 128
j: 256
j: 512
j: 1024
j: 2048
j: 4096
j: 8192
j: 16384
j: 32768
j: 65536
j: 131072
j: 262144
j: 524288
j: 1048576
j: 2097152
j: 4194304
j: 8388608
j: 16777216
j: 33554432
j: 67108864
j: 134217728
j: 268435456
j: 536870912
j: 1073741824
stderr
Unhandled Exception:
System.OverflowException: Arithmetic operation resulted in an overflow.
  at Program.Main () [0x00043] in <7036407466f24234a4d2e95205c4fde4>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.OverflowException: Arithmetic operation resulted in an overflow.
  at Program.Main () [0x00043] in <7036407466f24234a4d2e95205c4fde4>:0