Decimal.Multiply() Method in C# Last Updated : 06 Aug, 2021 Summarize Comments Improve Suggest changes Share Like Article Like Report This method is used to multiply two specified decimal values. Syntax: public static decimal Multiply (decimal a1, decimal a2);Parameters: a1: This parameter specifies the multiplicand. a2: This parameter specifies the multiplier.Return Value: The result of the multiplication of a1 & a2. Exception: This method will give OverflowException if the return value is less than MinValue or greater than MaxValue. Below programs illustrate the use of Decimal.Multiply(Decimal, Decimal) Method Example 1: C# // C# program to demonstrate the // Decimal.Multiply(Decimal, // Decimal) Method using System; using System.Globalization; class GFG { // Main Method public static void Main() { try { // Declaring the decimal variables Decimal a1 = 4.02m; Decimal a2 = 2.01m; // multiplying the two Decimal value // using Multiplying() method; Decimal value = Decimal.Multiply(a1, a2); // Display the product Console.WriteLine("Result of multiplication : {0}", value); } catch (OverflowException e) { Console.Write("Exception Thrown: "); Console.Write("{0}", e.GetType(), e.Message); } } } Output: Result of multiplication : 8.0802 Example 2: Program for OverflowException C# // C# program to demonstrate the // Decimal.Multiply(Decimal, // Decimal) Method using System; using System.Globalization; class GFG { // Main Method public static void Main() { try { // Declaring the decimal variables Decimal a1 = 4.02m; Decimal a2 = Decimal.MaxValue; // multiplying the two Decimal value // using Multiply() method; Decimal value = Decimal.Multiply(a1, a2); // Display the product Console.WriteLine("Result of multiplication : {0}", value); } catch (OverflowException e) { Console.Write("Exception Thrown: "); Console.Write("{0}", e.GetType(), e.Message); } } } Output: Exception Thrown: System.OverflowException Comment More infoAdvertise with us Next Article Decimal.Subtract() Method in C# I IshwarGupta Follow Improve Article Tags : C# CSharp-method CSharp-Decimal-Struct Similar Reads Decimal.ToSingle() Method in C# This method is used to convert the value of the specified Decimal to the equivalent single-precision floating-point number. This method can produce round-off errors as a single-precision floating-point number has few significant digits than a Decimal. Syntax: public static float ToSingle (decimal d) 1 min read Decimal.Subtract() Method in C# This method is used to subtract the one specified Decimal value from another. Syntax: public static decimal Subtract (decimal a1, decimal a2); Parameters: a1: This parameter specifies the minuend. a2: This parameter specifies the subtrahend. Return Value: Result of subtracting a2 from a1. Exceptions 2 min read Decimal.Add() Method in C# This method is used to add two specified decimal values. Syntax: public static decimal Add (decimal a1, decimal a2); Parameters: a1: This parameter specifies the first value to add. a2: This parameter specifies the second value to add. Return Value: Decimal sum of a1 & a2. Exceptions: This metho 2 min read Decimal.Floor() Method in C# This method is used to round the decimal to the closest integer toward negative infinity. Syntax: public static decimal Floor (decimal d); Parameter: d: This parameter specifies the decimal which will be rounded off. Return Value: If d has a fractional part, the next whole Decimal number toward nega 2 min read Decimal.Divide() Method in C# This method is used to divide the two specified decimal values. Syntax: public static decimal Divide (decimal a1, decimal a2); Parameters: a1: This parameter specifies the dividend. a2: This parameter specifies the divisor. Return Value: The result of dividing a1 by a2. Exceptions: DivideByZeroExcep 2 min read DateTime.Subtract() Method in C# This method is used to subtract the specified time or duration from this instance. There are 2 methods in the overload list of this method as follows: Subtract(DateTime) Subtract(TimeSpan) DateTime.Subtract(DateTime) This method is used to subtract the specified date and time from this instance. Syn 3 min read Like