Demonstrate a block of code inside if statement : For : Statement C# Examples


C# Examples » Statement » For »

 

Demonstrate a block of code inside if statement









    
using  System;  
  
class  MainClass  {  
    public  static  void  Main()  {  
        int  i,  j,  d;  
  
        i  =  5;  
        j  =  10;  
  
        if(i  !=  0)  {  
            Console.WriteLine("i  does  not  equal  zero");  
            d  =  j  /  i;  
            Console.WriteLine("j  /  i  is  "  +  d);  
        }  
    }  
}
    
   
  
   



Output

i does not equal zero
j / i is 2


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Statement
» For