The source code to demonstrate the binary minus (-) operator with TimeSpan structure is given below. The given program is compiled and executed successfully.
using System;
class TimeSpanDemo
{
//Entry point of Program
static public void Main()
{
TimeSpan timespan1 = new TimeSpan(2, 0, 0);
TimeSpan timespan2 = new TimeSpan(0, 90, 0);
Console.WriteLine(timespan1-timespan2);
}
}
Program:
The source code to demonstrate the binary minus (-) operator with TimeSpan structure is given below. The given program is compiled and executed successfully.
Output: