Pages

Write a program that take any month num as input and program decides that in which season the given month exist.

Input:

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

namespace _22222222222
{   
   class Program
    {
        static void Main(string[] args)
        {
            int rep;
            Console.WriteLine("enter month num");
            rep=Convert.ToInt32(Console.ReadLine());
            if ((rep == 12) || (rep == 2) || (rep == 1))
            {
                Console.WriteLine("Given month is in winter season");
            }
            else
                if ((rep == 3) || (rep == 4) || (rep == 5))
                {
                    Console.WriteLine("Given month is in spring season");
                }
                else
            if ((rep == 6) || (rep == 7) || (rep == 8))
            {
                Console.WriteLine("Given month is in summer season");
            }
            else
                if ((rep == 9) || (rep == 10) || (rep == 11))
                {
                    Console.WriteLine("Given month is in Autum season");
                }
        }
    }
}

Output:


No comments:

Post a Comment