Odd numbers descending Learn programming with C# Sharp exercises

Lesson:

Flow Control


Exercise:

Odd numbers descending 55


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;
        }
    }
}