150 likes | 278 Views
Math. By: Mr. McTavish. BASIC OPERATIONS. Addition: + Subtraction: - Multiplication: * Division: / Modulus (division remainder): %. Integer addition. Int32 intOp1 = 3; Int32 intOp2 = 4 ; Console.WriteLine ("Integer Addition: " + (intOp1 + intOp2). ToString ());.
E N D
Math By: Mr. McTavish
BASIC OPERATIONS • Addition: + • Subtraction: - • Multiplication: * • Division: / • Modulus (division remainder): %
Integer addition • Int32 intOp1 = 3; • Int32 intOp2 = 4; • Console.WriteLine("Integer Addition: " • + (intOp1 + intOp2).ToString());
Double addition • Double dblOp1 = 3.1; • Double dblOp2 = 4.2; • Console.WriteLine("Double Addition: " • + (dblOp1 + dblOp2).ToString());
Integer Multiplication • Int32 intOp1 = 3; • Int32 intOp2 = 4; • Console.WriteLine("Integer Multiplication: " • + (intOp1 * intOp2).ToString());
Double Multiplication • Double dblOp1 = 3.1; • Double dblOp2 = 4.2; • Console.WriteLine("Double Multiplication: " • + (dblOp1 * dblOp2).ToString());
Integer Division • Int32 intOp1 = 3; • Int32 intOp2 = 4; • Console.WriteLine("Integer Multiplication: " • + (intOp1 / intOp2).ToString());
Double Division • Double dblOp1 = 3.1; • Double dblOp2 = 4.2; • Console.WriteLine("Double Multiplication: " • + (dblOp1 / dblOp2).ToString());
Integer Division • Int32 intOp1 = 3; • Int32 intOp2 = 4; • Console.WriteLine("Integer Multiplication: " • + (intOp1 / intOp2).ToString());
Integer divided by double • Int32 intOp1 = 3; • Double dblOp2 = 4.2; • Console.WriteLine("Int Divided by Double: " • + (intOp1 / dblOp2).ToString());
Integer modulus • Int32 intOp1 = 3; • Int32 intOp2 = 4; • Console.WriteLine("Integer Modulus: " • + (intOp1 % intOp2).ToString());
Double modulus • Double dblOp1 = 3.1; • Double dblOp2 = 4.2; • Console.WriteLine("Double Modulus: " • + (dblOp1 % dblOp2).ToString());
Exponents • Console.WriteLine("Exponents: " • + (Math.Pow(dblOp1,dblOp2).ToString()));
Sine • Console.WriteLine("Sin (Warning: Radians!): " • + (Math.Sin(dblOp1).ToString()));Console.WriteLine("Sin (Warning: Radians!): " • + (Math.Sin(dblOp1).ToString()));
Concatenation • Console.WriteLine(String.Concat("This ","will ","look ","like ","a ","sentence.\n\t","Cool!"));