Decimal.Multiply() Method in C# Last Updated : 06 Aug, 2021 Comments Improve Suggest changes 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.ToSingle() 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.ToInt32() Method in C# This method is used to convert the value of the specified Decimal to the equivalent 32-bit signed integer. A user can also convert a Decimal value to a 32-bit integer by using the Explicit assignment operator. Syntax: public static int ToInt32 (decimal value); Here, the value is the decimal number w 2 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.ToDouble() Method in C# This method is used to convert the value of the specified Decimal to the equivalent double-precision floating-point number. This method can produce round-off errors as a double-precision floating-point number has few significant digits than a Decimal. Syntax: public static double ToDouble (decimal d 1 min read Decimal.Negate() Method in C# This method is used to get the result of multiplying the specified Decimal value by negative one. Syntax: public static decimal Negate (decimal a); Parameter: a: This parameter specifies the decimal which will be converted. Return Value: A decimal number with the value of a, but the opposite sign. B 2 min read Decimal.Remainder() Method in C# This method is used to compute the remainder when the division is done between two specified decimal values. Syntax: public static decimal Remainder (decimal a1, decimal a2); Parameters: a1: This parameter specifies the dividend. a2: This parameter specifies the divisor. Return Value: It returns the 2 min read Like