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
Ivanshal [37]
3 years ago
14

What is the output of the following Java code?int x = 1;do{System.out.print(x + " ");x--;}while (x > 0);System.out.println();

Computers and Technology
1 answer:
professor190 [17]3 years ago
5 0

Answer:

The output is 1.

Explanation:

int x = 1;

do{

System.out.print(x + " ");

x--;

}while (x > 0);

System.out.println();

The statement above is an example of a do-while loop which is always executed at least once.

In the above code snippet:

1 is assigned to x in the first line. Then the do keyword start the loop block. Inside the loop block, the value of x is output which is one (1). Then, the value of x is decreased by one, making x = 0. Then, the while keyword is reached where the condition is tested. The condition check whether x > 0 i.e whether 0 > 0. Off course, the condition is false and the loop is exited.

The last statement print a single line to the screen.

You might be interested in
What is a good coding site
Helga [31]

Sratch.com

-Agarvated

6 0
3 years ago
Write two statements to get input values into birthMonth and birthYear. Then write a statement to output the month, a slash, and
Montano1993 [528]

Answer:

1/2000

Explanation:

import java.util.Scanner;

public class InputExample {

public static void main(String [] args) {

Scanner scnr = new Scanner(System.in);

System.out.print("Enter birth month and date:");//comment this line if not needed

int birthMonth=scnr.nextInt();

int birthYear=scnr.nextInt();

String output= birthMonth+"/"+birthYear+"\n";

System.out.println(output);

}

}

if using this code the out put should be 1/2000

5 0
3 years ago
Floating point values (real numbers that can handle up to 5 decimals)
Ann [662]

Answer:

1.45638

Explanation:

p please mark me as brainlest

4 0
3 years ago
WHAT ARE THE RISK OF DUST​
Step2247 [10]

Answer:

over heating

Explanation:

in computers dust acts as a blanket which traps heat, excessive heat causes components to burn up and short out

3 0
3 years ago
Information should be________to ensure more than one source provides the same factual information. a. repeated c. cross-lined b.
Assoli18 [71]

Information should be cross-checked to ensure more than one source provides the same factual information.

<h3>What is the source of information?</h3>

The source of information is the place, from where the data or information is generated. There are many sources of information, like internet, newspaper, television etc.

The options given in the problem regarding the information as,

  • a. repeated
  • b. cross-examined
  • c. cross-lined
  • d. cross-checked

There are many feck news and nonfactual data is present over the internet and other source of information.

To get the factual information, one should always cross-checked the information from other sources.

Thus, the information should be cross-checked to ensure more than one source provides the same factual information.

Learn more about the source of information here;

brainly.com/question/26169752

7 0
2 years ago
Other questions:
  • Write a C program to calculate monthly payment and print a table of payment schedule for a fixed rate loan.
    7·1 answer
  • A network technician is assisting the security team with some traffic captures. The security team wants to capture all traffic o
    9·1 answer
  • The members of the IT department have spent two days debating the best approach to roll out the new software update. After allow
    15·1 answer
  • T FROW PYCW GCYN TA T ODYHP WQROW TW<br><br> Someone decode pls
    14·1 answer
  • An analog signal maintains a constant signal level for a period of time, then abruptly changes to a different constant level.
    5·2 answers
  • Acciones de un lápiz
    7·1 answer
  • Two friends can share 100 songs from their Bluetooth enabled mobile devices
    13·1 answer
  • Policies and procedures set by companies are established to :
    15·1 answer
  • Write a program that asks the user for the name of a file. The program should display the contents of the file with each line pr
    13·1 answer
  • What is destination email address​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!