C# Program to Demonstrate the Unary Minus (-) Operator With Timespan Structure

You are currently viewing C# Program to Demonstrate the Unary Minus (-) Operator With Timespan Structure

C# program to demonstrate the unary minus (-) operator with TimeSpan structure

using System;

class TimeSpanDemo
{
    //Entry point of Program
    static public void Main()
    {
        TimeSpan timeInterval = new TimeSpan(4, 10, 15);
        Console.WriteLine(+timeInterval);
    }
}

Output

-04:10:15
Press any key to continue . . .

Ranjith Kumar

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

Leave a Reply