Venciity

BitWiseOperators - n Multipled By 32

Jan 30th, 2014
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.48 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ex4
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int n = 42;                         //00000000 00101010
  14.             int nMultipledBy32 = n << 5;        //00000101 01000000    
  15.             Console.WriteLine(nMultipledBy32);  //42 * 32 = 1344
  16.  
  17.             //n << 6 = 64 ( 2 * 32 )
  18.         }
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment