NedyalkoKikov

ObjectAndClasses

May 18th, 2016
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 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 ObjectAndClasses
  8. {
  9. class ObjectAndClasses
  10. {
  11. static void Main()
  12. {
  13. DateTime peterBirtday = new DateTime(1996, 11, 27);
  14. DateTime mariaBirthday = new DateTime(1995, 6, 14);
  15. Console.WriteLine("Peters birhdate {0:d-MM-yyyy}", peterBirtday);
  16. Console.WriteLine("Marias birthdate {0:d-MM-yyyy}",mariaBirthday);
  17. DateTime maria18Month = mariaBirthday.AddMonths(18);
  18. Console.WriteLine("Maria at 18 months:{0:d-MM-yyyy}",maria18Month);
  19. TimeSpan ageDiff = peterBirtday.Subtract(mariaBirthday);
  20. Console.WriteLine("Maria older than Peter by {0} days", ageDiff.Days);
  21. }
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment