Mega Code Archive

 
Categories / C# Book / 01 Language Basics
 

0056 Arithmetic operators

C# defines the following arithmetic operators. Operator Meaning + Addition - Subtraction * Multiplication / Division % Remainder The following code illustrates how to use the basic arithmetic operators. using System; class Program { static void Main(string[] args) { int i = 4; int j = 5; int result = i + j; Console.WriteLine(result); } } The result 9