Arithmetic Operators

C#To perform any kind of mathematical calculation in C#, we make use of Arithmetic Operators.  The list of Arithmetic Operators is given below.

  • Addition +
  • Subtraction –
  • Division /
  • Multiplication *
  • Modulus %

A very simple code is given below for the demonstration of Addition + operator.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
using System;
public class Program
{
public static void Main()
{
int number = 2 + 6;
Console.WriteLine(number);
}
}
using System; public class Program { public static void Main() { int number = 2 + 6; Console.WriteLine(number); } }
using System;

public class Program
{
public static void Main()
{

int number = 2 + 6;

Console.WriteLine(number);
}
}