Demonstrate a block of code : If : Language Basics C# Source Code


Custom Search

C# Source Code » Language Basics » If »

 

Demonstrate a block of code









    

/*
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); 
    } 
  } 
}

           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Language Basics
» If