binary

binary

Hi

I want to write a program in pascal that ask a user to input a decimal number and then return its binary equivalent in the minimum number of bits required to repesent the number.

Thks

View Answers

June 22, 2011 at 12:45 PM

import java.util.*;
public class DecimalToBinary{
  public static void main(String args[]){
  Scanner input=new Scanner(System.in);
  System.out.println("Enter the decimal value:");
  int num = input.nextInt();
  String binary = Integer.toBinaryString(num);
  System.out.println("Binary: " + binary);
  }
}

June 23, 2011 at 11:09 PM

Hi

Can I have the program in pascal language

Thks

Ads









Related Tutorials/Questions & Answers:
binary
binary  Hi I want to write a program in pascal that ask a user to input a decimal number and then return its binary equivalent in the minimum number of bits required to repesent the number. Thks
Binary tree
Binary tree  a. Construct a method to implement a binary tree using an array. b. Implement the binary tree to store numbers in sorted order
Advertisements
binary tree
binary tree  can a binary tree be implemented with out comparing...://www.roseindia.net/java/java-get-example/java-binary-tree-code.shtml http://www.roseindia.net/java/java-get-example/java-binary-tree-insert.shtml
binary tree
binary tree  how to count no. of nodes in a binary tree for mlm if it complet tree or incomplet tree in php using mysql db
octal to binary
octal to binary  i want to know how to convert a octal to binary number   Here is a java example that converts octal to binary. import... binary=Integer.toBinaryString(i); System.out.println(binary
program binary
program binary  Hi I want to write a program in pascal that ask a user to input a decimal number and then return its binary equivalent in the minimum number of bits required to repesent the number. In pascal language please
binary search program
binary search program  write a program to searching a string using binary search
binary search program
binary search program  write a program to searching a string using binary search
binary search program
binary search program  write a program to searching a string using binary search
binary search program
binary search program  write a program to searching a string using binary search
binary search program
binary search program  write a program to searching a string using binary search
universal binary for ipad iphone
universal binary for ipad iphone  How can i create a universal binary for iPad and iPhone
ModuleNotFoundError: No module named 'binary'
ModuleNotFoundError: No module named 'binary'  Hi, My Python... 'binary' How to remove the ModuleNotFoundError: No module named 'binary'... to install padas library. You can install binary python with following command
swing program for decimal to binary
swing program for decimal to binary  swing program for decimal to binary
Binary Search on array
Binary Search on array  What requirement is placed on an array, so that binary search may be used to locate an entry? ? The array elements must form a heap. ? The array must have at least 2 entries. ? The array must
Java read binary file
Java read binary file  I want Java read binary file example code that is easy to read and learn. Thanks   Hi, Please see the code at Reading binary file into byte array in Java. Thanks   Hi, There is many
send Binary Data by doGet or doPost?
send Binary Data by doGet or doPost?  which method in doGet or doPost is use to send binary date to server
java binary file io example
java binary file io example  java binary file io example
binary search tree
binary search tree  Construct a binary search tree by inserting the following sequence of characters into an empty tree. N O N L I N E A R D A T A Visit the tree using all three traversal algorithms and list the output sequence
binary search tree
binary search tree  Construct a binary search tree by inserting words into an empty tree. "cut your coat according to your cloth" Visit the tree using all three traversal algorithms and list the output sequence for each algorithm
ModuleNotFoundError: No module named 'attrs-binary'
ModuleNotFoundError: No module named 'attrs-binary'  Hi, My Python... 'attrs-binary' How to remove the ModuleNotFoundError: No module named 'attrs-binary' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'binary_clock'
ModuleNotFoundError: No module named 'binary_clock'  Hi, My Python... 'binary_clock' How to remove the ModuleNotFoundError: No module named 'binary_clock' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'binary-core'
ModuleNotFoundError: No module named 'binary-core'  Hi, My Python... 'binary-core' How to remove the ModuleNotFoundError: No module named 'binary-core' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'binary-heap'
ModuleNotFoundError: No module named 'binary-heap'  Hi, My Python... 'binary-heap' How to remove the ModuleNotFoundError: No module named 'binary-heap' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'binary-helpers'
ModuleNotFoundError: No module named 'binary-helpers'  Hi, My... named 'binary-helpers' How to remove the ModuleNotFoundError: No module named 'binary-helpers' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'binary-pairs'
ModuleNotFoundError: No module named 'binary-pairs'  Hi, My Python... 'binary-pairs' How to remove the ModuleNotFoundError: No module named 'binary-pairs' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'binary-refinery'
ModuleNotFoundError: No module named 'binary-refinery'  Hi, My... named 'binary-refinery' How to remove the ModuleNotFoundError: No module named 'binary-refinery' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'binary-repr'
ModuleNotFoundError: No module named 'binary-repr'  Hi, My Python... 'binary-repr' How to remove the ModuleNotFoundError: No module named 'binary-repr' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'binary-search'
ModuleNotFoundError: No module named 'binary-search'  Hi, My... 'binary-search' How to remove the ModuleNotFoundError: No module named 'binary-search' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'binary-tostring'
ModuleNotFoundError: No module named 'binary-tostring'  Hi, My... named 'binary-tostring' How to remove the ModuleNotFoundError: No module named 'binary-tostring' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'binary-to-string'
ModuleNotFoundError: No module named 'binary-to-string'  Hi, My... named 'binary-to-string' How to remove the ModuleNotFoundError: No module named 'binary-to-string' error? Thanks   Hi, In your

Ads