The following Arithmetic Operators are supported in C#
+ (Addition)
– (Subtraction)
/ (Division)
* (Multiplication)
++ (Increment)
— (Decrement)
% (Modulus)
Below is a sample code snippet demonstrating the usage of Arithmetic operators in C#
using System; namespace AbundantCode { internal class Program { //Arithmetic Operators in C# private static void Main(string[] args) { int Input = 100, Output = 50; Input = Input + Output; Input = Input - Output + 100; Output = Input * 5; Input = Output / 2; Output = Input % 2; Console.WriteLine("The output of the AbundantCode is " + Output.ToString()); Console.ReadLine(); } } }
Leave a Reply