Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as C# by Check ( 15 years ago )
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int day,month,year;
            Console.WriteLine("Enter day");
            day = int.Parse(Console.ReadLine());
            Console.WriteLine("Enter month");
            month = int.Parse(Console.ReadLine());
            Console.WriteLine("Enter year");
            year = int.Parse(Console.ReadLine());
            switch(day)
            {
                case 1:
                case 3:
                case 5:
                case 7:
                case 8:
                case 10:
                case 12:
                    if(day>31 || day<1);
                    {
                        if(day==31);
                        {
                            day=1;
                        }
                        else
                        {
                            day=day+1;
                        }
                    }
                    else
                    {
                    Console.WriteLine("No such day");
                    }
                    break;
        }
    }
}

 

Revise this Paste

Parent: 39905
Your Name: Code Language: