Answers for "odd number print code in c#"

C#
0

odd number print code in c#

using System;  
public class Exercise25
{  
    public static void Main() 
      {     
          Console.WriteLine("Odd numbers from 1 to 99. Prints one number per line.");
          for (int n = 1; n < (99 + 1); n++)
            {
                if (n % 2 != 0)
                {
                    Console.WriteLine(n.ToString());
                }
            }
                    
    }
}
Posted by: Guest on September-15-2021

C# Answers by Framework

Browse Popular Code Answers by Language