Advertisement
Dianov

Basic Syntax, Conditional Statements and Loops - Lab (05. Month Printer)

Mar 11th, 2021
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.68 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace MonthPrinter
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int month = int.Parse(Console.ReadLine());
  14.  
  15.             if (month == 1)
  16.             {
  17.                 Console.WriteLine("January");
  18.             }
  19.             else if (month == 2)
  20.             {
  21.                 Console.WriteLine("February");
  22.             }
  23.             else if (month == 3)
  24.             {
  25.                 Console.WriteLine("March");
  26.             }
  27.             else if (month == 4)
  28.             {
  29.                 Console.WriteLine("April");
  30.             }
  31.             else if (month == 5)
  32.             {
  33.                 Console.WriteLine("May");
  34.             }
  35.             else if (month == 6)
  36.             {
  37.                 Console.WriteLine("June");
  38.             }
  39.             else if (month == 7)
  40.             {
  41.                 Console.WriteLine("July");
  42.             }
  43.             else if (month == 8)
  44.             {
  45.                 Console.WriteLine("August");
  46.             }
  47.             else if (month == 9)
  48.             {
  49.                 Console.WriteLine("September");
  50.             }
  51.             else if (month == 10)
  52.             {
  53.                 Console.WriteLine("October");
  54.             }
  55.             else if (month == 11)
  56.             {
  57.                 Console.WriteLine("November");
  58.             }
  59.             else if (month == 12)
  60.             {
  61.                 Console.WriteLine("December");
  62.             }
  63.             else
  64.             {
  65.                 Console.WriteLine("Error!");
  66.             }
  67.         }
  68.     }
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement