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]
3 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]3 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
If you hold down the alt key and click anywhere in your document what happens
sukhopar [10]
<span>The Alt key on a PC is utilised to change the capacity of other squeezed keys. It will go to any desired short cut in the computer that is being accessed. in short , one can use this to reach other functionality of a windows based computer easily. For example, if you were accessing documents and you want to skip to a different function from what you were doing on the desktop.</span>
4 0
4 years ago
Meenakshi has created a presentation of six slides. The slides have the same background, but s wants to change the background of
sdas [7]
Ans:- Using Background Styles button present in Background group on the Design tab.
5 0
2 years ago
Match the tool to the task it helps to accomplish.
olga2289 [7]

Answer:

Translate ➡️ allows the user to change words from one language to another

Smart Lookup➡️allows user to find the definition of a word or a phrase.

Thesaurus ➡️ allows the user to find the synonyms and antonyms of a word.

Explanation:

I have been able to match each took to the tasks that they perform.

In Translate, users can easily change words into a different language. That means that words in English can be translated into French, Spanish, etc., and vice versa.

In Smart Lookup, users can actually find definitions of words or phrases. Smart Lookup can be found in Microsoft Word Office.

The Thesaurus is used to find the synonyms and antonyms of words.

These tools make learning very easy and enjoyable.

8 0
3 years ago
What will be the answer?
Usimov [2.4K]

Answer:

NumPy

Explanation:

6 0
3 years ago
Read 2 more answers
List the seven steps used by a laser printer to print a page
Schach [20]
T<span>he seven steps used by a laser printer to print a page are :
</span>1)  Processing, this is where he computer sends the data to the printer.
2)  Charging, where <span>the wire (primary corona) negatively charges the
     photoconductive drum.</span>
3)  Exposing, where <span>the laser scans the image to the drum. Anywhere the
     laser touches the drum causes the electrical charge to drain off.</span>
4)  Developing, where <span>negatively charged toner particles are allowed to
     attach to the painted area of the drum; since the negative charge has
     been drained off these areas</span>
5) Transferring, where the transfer corona wire charges the paper with a
     positive charge from behind. The negatively charged toner jumps to the
     positive paper, according to the image on the drum. <span>A Static Charge
     eliminator then removes any residual charge.
</span>6) Fusing, where t<span>he toner particles attached to the paper are fused or
     melted to the paper, because of the heated drum.</span>
7) Cleaning, where t<span>he drum is cleaned of excessive toner and electrical
    charges.</span>
7 0
3 years ago
Read 2 more answers
Other questions:
  • Judy forgot where she saved a certain file on her computer. Therefor, she searches for all files with a jpg file extension. Whic
    11·2 answers
  • What are the tab keys used for on a keyboard
    12·1 answer
  • If we have a priority queue storing approximately million numbers, and the bottom level is "full", which of the following statem
    9·1 answer
  • Through the use of a _____ system, information on prospective, current, and past customers is stored and analyzed for future pla
    15·1 answer
  • Select the correct answer
    5·2 answers
  • If the supply of computer engineers increases at the same time that the demand for these workers decreases, what would be the MO
    7·1 answer
  • Which amendment applies to the following scenario? “Brian attended church with his two daughters and wife on Sunday." A First B
    15·1 answer
  • How to convert meters to centimeters in c programming​
    8·1 answer
  • Sam works in a real estate office. An offer comes in on a house but the homeowners are on vacation. He needs the homeowners to s
    13·1 answer
  • Questic
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!