[ New messages · Members · Forum rules · Search · RSS ]
  • Page 1 of 1
  • 1
Bit Representation
dksDate: Monday, 24 February 14, 6:00 PM | Message # 1
New Lit
Group: Friends
Messages: 4
Status: Offline
import java.util.Scanner;

class BitRepresent
{
   public static void main(String args[])
   {
      Scanner input=new Scanner(System.in);
      int counter=0;
      System.out.println("Enter the number:");
      int n=input.nextInt();
      while(n!=0)

       {
          n=n/2;
          counter++;  
       }
     System.out.println("No. of Bit="+counter);
  }
}

Added (24 February 14, 6:00 PM)
---------------------------------------------
Thanks to all for viewing ,if any comment ...

 
  • Page 1 of 1
  • 1
Search: