@nakov/

for-loop-step-minus-2-csharp

C#

Demonstrate a for-loop with step -2 in C#

fork
loading
Files
  • main.cs
  • main.exe

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.2766031176895838","path":"main.cs","file":{"path":"main.cs","content":{"asEncoding":{"base64":"dXNpbmcgU3lzdGVtOwoKY2xhc3MgRm9yTG9vcFN0ZXBNaW51czIgewogICAgcHVibGljIHN0YXRpYyB2b2lkIE1haW4oKSB7ICAgICAgICAKICAgICAgICBmb3IgKGludCBpID0gMTA7IGkgPj0gMDsgaS09MikKICAgICAgICAgICAgQ29uc29sZS5Xcml0ZShpICsgIiAiKTsKICAgIH0KfQo="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
using System;

class ForLoopStepMinus2 {
    public static void Main() {        
        for (int i = 10; i >= 0; i-=2)
            Console.Write(i + " ");
    }
}