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
mestny [16]
2 years ago
15

Write a while (or for) statement to print all the digits of an int type variable x, one digit per line. For example, if int x

Computers and Technology
1 answer:
Vlada [557]2 years ago
7 0

<em>Complete Question:</em>

<em>Write a while (or for) statement to print all the digits of an int type variable x, one digit per line For example, if int x 38625, then the output should be in 5 lines as 60 (Hint: You may use built-in method to get a String representation of x then print out each character in String)</em>

***** Java *****

Answer:

import java.util.*;

public class Main{  

public static void main(String args[])  {  

Scanner input = new Scanner(System.in);

System.out.print("Enter an integer: ");

int x = input.nextInt();

String str = Integer.toString(x);  

for(int i =0;i<str.length();i++)  {

    System.out.println(str.charAt(i));

}

}  

}  

Explanation:

This line prompts user for input

System.out.print("Enter an integer: ");

This line gets user input

int x = input.nextInt();

This line converts user input to string

String str = Integer.toString(x);  

The following loop iterates through the converted string

for(int i =0;i<str.length();i++)  {

This prints each character on the string

    System.out.println(str.charAt(i));

}

You might be interested in
Pls help me pls I’m struggling
steposvetlana [31]
You have it correct
6 0
2 years ago
PLEASE HELP!!!!!!!!!!! If you whisper while telling someone a secret, your nonverbal communication is          your verbal inter
Assoli18 [71]
The answer is repeating 
3 0
2 years ago
What is the virus removal credit awarded to a properly operated conventional treatment plant?
GenaCL600 [577]

<u>2 logs is </u>the virus removal credit awarded to a properly operated conventional treatment plant.

<h3>What is the log removal for viruses?</h3>

A log removal value (LRV) is a measurement of the ability of treatment processes to remove pathogenic microorganisms. LRVs are specified by taking the logarithm of the ratio of pathogen concentration in the influent and effluent water of a restorative process (shown in Equation 1).

<h3>What is log inactivation?</h3>

“Log inactivation” is a suitable way to express the number or percent of microorganisms inactivated (killed or unable to replicate) through the disinfection process. For example, a 3 log inactivation value means that 99.9% of microorganisms of claim have been inactivated.

To learn more about log removal value, refer

brainly.com/question/28136724

#SPJ4

5 0
1 year ago
A technician has been told that a keyboard is not responding at all. What can the technician do quickly to determine whether tha
givi [52]

Answer:

Press Caps Lock key to see the light illuminates or not

Explanation:

Computer keyboard is the typewriter-style device that uses arrangement of the buttons or the keys to act as the mechanical levers or the electronic switches.

Keyboard keys  have characters which are engraved or printed on the surface and press of each key corresponds to the single written symbol.

If the keyboard is not working and to see whether it is working or not, there is a Caps Lock key on the keyboard. Generally, all keyboards have a Caps Lock light which will light up if the button is on. So, this can be a quick check.

6 0
3 years ago
Should I Ban Pog on my Discord Server
IRINA_888 [86]

Answer:

Do as you wish :)

6 0
3 years ago
Read 2 more answers
Other questions:
  • What is the range of the well-known ports used by tcp and udp?
    5·1 answer
  • Looking at your Personal Fact Sheet, do you see any areas that may need improvement? In which areas do you have the most room fo
    8·2 answers
  • Technician A says you should measure the parasitic load immediately after the vehicle is turned off. Technician B says you shoul
    10·1 answer
  • What is the benefit to displaying the merge codes in a document?
    9·1 answer
  • :If a process terminates, will its threads also terminate or will they continue to run? Explain your answer.
    14·1 answer
  • What kind of operating system is MS-DOS?
    8·2 answers
  • In what way are a coffee maker and a dishwasher the same?<br><br>BY THE WAY THIS IS TEENBIZ
    9·2 answers
  • The following program is supposed to display a message indicating if the integer entered by the user is even or odd. What is wro
    13·1 answer
  • A Python file that contains variables and functions and can be used in other programs is called a
    5·1 answer
  • What is an advantage of using a dynamic hard drive in a vm?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!