Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using
- System;
- using
- System.Collections.Generic;
- using
- System.Linq;
- using
- System.Text;
- namespace
- ConsoleApplication1
- {
- classProgram
- {
- staticvoid Main(string[] args)
- {
- int years;
- int months;
- int days;
- Console.WriteLine("inserd date in this formad dd/mm/yyyy: ");
- Console.WriteLine("Days: ");
- days =
- int.Parse(Console.ReadLine());
- Console.WriteLine("Months: ");
- months =
- int.Parse(Console.ReadLine());
- Console.WriteLine("Years: ");
- years =
- int.Parse(Console.ReadLine());
- if (years < 9999 && years > 0 && months > 1 && months < 12 && days > 1 && days < 31)
- Console.WriteLine("date inserted correctly");
- else
- Console.WriteLine("date inserted incorrect");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement