# Tag: binary

## Addition of two given numbers

Basically is about the binary numbers, the user needs to input two random numbers, both numbers will be added, and the addition of those two numbers only needs to have ones and zeros for example 5+6==11 OR 55+55=110, then throw a message saying “the addition only has 1’s and 0’s, otherwise for example 25+46=71 or 575+575=1150 then a message saying

## decimal value of the number formed by concatenating the binary representations of first n natural numbers

Given a number n, find the decimal value of the number formed by concatenating the binary representations of first n natural numbers. Print answer modulo 10^9+7. Also, n can be as big as 10^9 and …

## change binary to decimal

I have to write a method that changes binary to decimal. Write a method that will convert the supplied binary digit (as a string) to a decimal number. convertToDecimal(“01101011”) = 107 convertToDecimal(“00001011”) = 11 i have created it to change decimal to binary however im not sure how to create it binary to decimal. Answer

## Convert Long to DateTime from C# Date to Java Date

I’ve been trying to read the binary file with Java, and the binary file is written in C#. And some of those data is contain a DateTime data. When DateTime data will be written into the file (in …

## Converting Decimal to Binary Java

I am trying to convert decimal to binary numbers from the user’s input using Java. I’m getting errors. How do I convert Decimal to Binary in Java? Answer Your binaryForm method is getting caught in an infinite recursion, you need to return if number <= 1:

## Bitwise operator for simply flipping all bits in an integer?

I have to flip all bits in a binary representation of an integer. Given: 10101 The output should be 01010 What is the bitwise operator to accomplish this when used with an integer? For example, …

## Determining binary/text file type in Java?

Namely, how would you tell an archive (jar/rar/etc.) file from a textual (xml/txt, encoding-independent) one?