Demonstrate a block of code

image_pdfimage_print

   

/*
C#: The Complete Reference 
by Herbert Schildt 

Publisher: Osborne/McGraw-Hill (March 8, 2002)
ISBN: 0072134852
*/
// Demonstrate a block of code. 
 
using System; 
 
public class BlockDemo { 
  public static void Main() { 
    int i, j, d; 
 
    i = 5; 
    j = 10; 
 
    // the target of this if is a block 
    if(i != 0) { 
      Console.WriteLine("i does not equal zero"); 
      d = j / i; 
      Console.WriteLine("j / i is " + d); 
    } 
  } 
}