Odd numbers descending Learn programming C# Sharp

Lesson:

Flow Control


Exercise:

Odd numbers descending 9


Objetive:

Create a C# program to display on the screen the odd numbers from 15 to 7 (downwards), using "while"


Code:

using System;
public class exercise24
{
    public static void Main()
    {
        int n = 15;

        while (n >= 7)
        {
            Console.WriteLine(n);
            n -= 2;
        }
    }
}