Q:

Write an application named OddNums that displays all the odd numbers from 1 through 99

0

Write an application named OddNums that displays all the odd numbers from 1 through 99.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using static System.Console;

namespace _8_OddNums
{
    class OddNums
    {
        static void Main(string[] args)
        {
            WriteLine("OddNums");

            int itr = 0;
            while (itr<100)
            {
                if (itr % 2 == 1)
                    WriteLine(itr);
                ++itr;
            }

            WriteLine("--End--");
        }
    }
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now