double num1 = 10.5; double num2 = 8.75; double sum = double.Add(num1, num2); // sum = 19.25
using System; class Program { static void Main() { double num1 = 6.25; double num2 = 3.75; double sum = Math.Round(double.Add(num1, num2), 2); Console.WriteLine(sum); } }In this example, we round the result of the double Add function to two decimal places using the Math.Round method. We also output the result to the console using the Console.WriteLine method. The double Add function is part of the System.Double struct in the .NET Framework Class Library.