Geeks With Blogs
Stephanie Grima C#, ASP.NET and my life.


The following are the basic arithmetic operators used in programming:

  • + : the sign indicating the operation of an Addition. Addition is when two numbers are added or combined to get an amount or total. It can also be the joining of two such as strings.
    • example: int x = 5; int y = 4; int z =  x+y; therefore, z = 9
    • example: string wordOne = "go"; string wordTwo = "away"; string phrase = wordOne + " " + wordTwo; thereforem phrase = "go away"
  • - : the sign indicating the operation of a Subtraction. Subtraction is used to find the difference between two values.
  • * : the sign indicating the operation of a Multiplication. Multiplication is ued to add together values of the same cardiality.
  • / : the sign indicating the operation of a Division. Division is used to see how many times a number is found in another number/
  • mod : mod is Modulus in short. The modulus is the remainder given from a division.
    • example: int result = 10 mod 6;
Posted on Wednesday, October 29, 2008 9:02 AM C# , Java | Back to top

Comments on this post: [C#] [Java] Basics : Arithmetic Operators

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © Steffi | Powered by: