Relational Operators

image_pdfimage_print

/*
* C# Programmers Pocket Consultant
* Author: Gregory S. MacBeth
* Email: gmacbeth@comporium.net
* Create Date: June 27, 2003
* Last Modified Date:
*/
using System;

namespace Client.Chapter_2___Common_Type_System
{
public class RelationalOperators
{
static void Main(string[] args)
{
int a, b;

a = 1;
b = 2;
if (a > b)
b = 10;

if (b < a) a = 10; if (a >= b)
b = 20;

if (b <= a) a = 20; if (a == b) b = 5; if (b != a) b = a; } } } [/csharp]

Numeric Operators 1

image_pdfimage_print
   
 
/*
 * C# Programmers Pocket Consultant
 * Author: Gregory S. MacBeth
 * Email: gmacbeth@comporium.net
 * Create Date: June 27, 2003
 * Last Modified Date:
 * Version: 1
 */
using System;

namespace Client.Chapter_2___Operators_and_Excpressions
{
  public class NumericOperators1
  {
    static void Main(string[] args)
    {
      int a, b, c, d, e;

      a = 1;
      a += 1;
      b = a;
      b -= 2;
      c = b;
      c *= 3;
      d = 4;
      d /= 2;
      e = 23;
      e %= 3;
    }
  }
}