CSharp - Write program to Get Tomorrow's Date

Requirements

You will write a program that displays tomorrow's date.

Hint

DateTime objects have more methods available, for example, Date arithmetic.

  • Using AddDays for date arithmetic
  • Using ToShortDateString for displaying the date in short form

Demo

using System;

class Program// w  ww.j  a  v  a 2  s  . com
{
    static void Main(string[] args)
    {
        // Today's date 
        DateTime today = DateTime.Today;

        // Tomorrow's date 
        DateTime tomorrow = today.AddDays(1);

        // Output 
        Console.WriteLine("Today is " + today.ToShortDateString() + ".");
        Console.WriteLine("I will start learning on " + tomorrow.ToShortDateString() + ".");
    }
}

Result