Cast byte back for byte calculation : Data Type Cast : Data Type C# Examples


C# Examples » Data Type » Data Type Cast »

 

Cast byte back for byte calculation









    
using  System;    
    
class  Example  {          
    public  static  void  Main()  {          
        byte  b;    
        
        b  =  10;    
        b  =  (byte)  (b  *  b);  //  cast  needed!
    
        Console.WriteLine("b:  "+  b);    
    }          
}
    
   
  
   



Output

b: 100


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Data Type
» Data Type Cast