Math operators : Math : Development Class C# Source Code


Custom Search

C# Source Code » Development Class » Math »

 

Math operators








    
 

using System;
class MathOpsApp
{
    static void Main(string[] args)
    {
        Random rand = new Random();
        int a, b, c;
   
        a = rand.Next() % 100; // Limit max to 99.
        b = rand.Next() % 100; // Limit max to 99.
   
        Console.WriteLine("a={0} b={1}", a, b);
   
        c = a * b;
        Console.WriteLine("a * b = {0}", c);
   
        c = a / b;
        Console.WriteLine("a / b = {0}", c);
   
        c = a + b;
        Console.WriteLine("a + b = {0}", c);
   
        c = a - b;
        Console.WriteLine("a - b = {0}", c);
   
        c = a % b;
        Console.WriteLine("a % b = {0}", c);
    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Development Class
» Math