1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
aleksandr82 [10.1K]
1 year ago
13

write a command-line program which prompts the user for a series of decimal integer values separated by spaces. display each dec

imal integer along with its equivalent binary value.
Computers and Technology
1 answer:
zepelin [54]1 year ago
5 0

A number expressed by 0s and 1s is referred to as a binary literal (binary digits). Integral types (byte, short, int, and long) can be expressed in Java using a binary number system.

The integral value might be prefixed with 0b or 0B to specify a binary literal. By constantly dividing the supplied number by 2 until we receive 0 as the quotient, we can convert a decimal number to a binary number in the simplest way possible. The binary value of the specified decimal number is then obtained by writing the remainders in reverse order. Any of the digits 0 through 9 can be found in a decimal integer literal. The octal integer literal, as opposed to the decimal integer literal, is used to interpret integer literals that start with the number 0.

Learn more about binary here-

brainly.com/question/19802955

#SPJ4

You might be interested in
What is the build in libary function to compare two strings?​
worty [1.4K]

Answer:

strcmp() is a built-in library function and is declared in <string. h> header file. This function takes two strings as arguments and compare these two strings lexicographically.

Explanation:

Hope it helps

3 0
4 years ago
Write an expression that executes the loop body as long as the user enters a non-negative number. Note: If the submitted code ha
madam [21]

Answer:

           while (Num>=0) {

               System.out.println("enter a another number");

               Num = in.nextInt();

           }

Explanation:

The complete java code prompting a user to enter a number until a negative number is entered is given below:

import java.util.Scanner;

public class num6 {

public static void main (String [] args) {

Scanner in = new Scanner(System.in);

System.out.println("enter a number");

int Num = in.nextInt();

while (Num>=0) {

System.out.println("enter a another number");

Num = in.nextInt();

}

System.out.println("Done.");

return;

}

}

3 0
4 years ago
Which of the following statements about relays is correct? A. A relay is a type of rheostat. B. A normally closed relay closes a
Sloan [31]
C. A relay is an electrical switch that works through electromagnetism. 
3 0
3 years ago
Read 2 more answers
What does a code of conduct include?
mariarad [96]
The answer is a set of rules for behavior when using the internet 
For example online bullying defies the code of conduct. 
3 0
3 years ago
Suppose that the UDP receiver computes the Internet checksum for the received UDP segment and finds that it matches the value ca
defon

Answer:

No, the receiver cannot be absolutely certain that no bit errors have occurred. This is because of the manner in which the checksum for the packet is calculated. If the corresponding bits (that would be added together) of two 16-bit words in the packet were 0 and 1 then even if these get flipped to 1 and 0 respectively, the sum still remains the same. Hence, the 1s complement the receiver calculates will also be the same. This means the checksum will verify even if there was transmission error

Explanation:

4 0
4 years ago
Other questions:
  • Most Answers MOST ANSWERS
    11·2 answers
  • When using a graphics editing program, which option allows you to adjust the space around an image?
    15·1 answer
  • How can my computer catch a virus?
    13·1 answer
  • Are there any human lanaguages with context free grammar
    11·1 answer
  • Help!!!!!!!!!!!!!!!!!!!
    12·1 answer
  • How to calculate a pid controller
    8·1 answer
  • Format character of Date function that display the day of the month in 2 digits with leading zeros such as 01 to 31
    11·1 answer
  • What does GUI stands for and what is it function?​
    5·2 answers
  • HELP ASAP WILL GIVE BRAINLY Question 19 Multiple Choice Worth 5 points) (05 03 MC) Network technologies specialist Hannah has be
    12·1 answer
  • Use a slicer to filter the data in this table to show only rows where the Category value is Coffee or Meals
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!