About 509,000 results
Open links in new tab
  1. java - How to convert a decimal to binary using for loops

    Mar 19, 2014 · /* This program converts decimal to binary */ import javax.swing.JOptionPane; public class BinaryLoop { public static void main(String []args) { String askForDecimal = …

  2. Program for Decimal to Binary Conversion - GeeksforGeeks

    Feb 4, 2025 · Given a decimal number n, the task is to convert the given decimal number into an equivalent binary number. Examples: The below diagram shows an example of converting the …

  3. Java Convert Decimal to Binary - Tpoint Tech

    To convert a decimal number to binary, you repeatedly divide the decimal number by 2 and keep track of the remainders. You start by dividing the decimal number by 2 and note down the …

  4. Convert Decimal to Binary in Java [Loop, Recursion] - Pencil Programmer

    To convert decimal into binary, we divide the decimal number by 2 until it reduces to 0. The bottom-up sequence of the remainders that we get after division is the binary representation of …

  5. Java Program to Convert Decimal to Binary - Scaler

    Sep 21, 2023 · You can use bitwise operators to convert decimal to binary in Java. Utilize shifts and masks to access binary bits efficiently. With fixed 32 iterations for 32-bit integers, time and …

  6. Java Program to Convert Decimal to Binary using Loop

    Sep 11, 2021 · In this tutorial, we will write a java program to convert decimal to binary without using array. Before that, you must have knowledge of the following topics in java. Java …

  7. Java Program for Decimal to Binary Conversion - Naukri Code 360

    Mar 23, 2025 · In this article, we will learn how to write a Java program to convert a decimal number to binary using methods like recursion, bitwise operations, and `Integer.toBinaryString()`.

  8. Java Program for Decimal to Binary Conversion - GeeksforGeeks

    Jul 10, 2024 · Given a decimal number as input, we need to write a program to convert the given decimal number into an equivalent binary number. Examples: Input : 7 Output : 111

  9. java - Coverting a decimal to binary using for loops ... - Stack …

    Jan 21, 2015 · I'm trying to write a program that converts decimal to binary and decimal to octal. I can convert from decimal to binary, but from decimal to octal it just doesn't work. import …

  10. Java program to convert a decimal to binary format for a float …

    Oct 3, 2021 · Java program to convert a decimal to binary format for a float or double value: In this post, we will write one Java program that will convert one decimal value to binary format. …

Refresh