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
Within the sites that support disaster recovery, ___________ is a separate and fully equipped facility where the company can mov
Dahasolnce [82]

Answer:

Hot site.

Explanation:

It seems to be a specific and completely designed functionality inside the sites which assist disaster recovery, in which the organization may travel directly during a disaster as well as continue operations.

  • It may be described as such a recovery site that is repeatedly fully operational.
  • It enables the corporation to resume normal corporate processes during a disaster, within such a limited period cycle.
7 0
4 years ago
Which extension is appropriate for Word document templates?
expeople1 [14]
The answer to this question is A
8 0
3 years ago
Read 2 more answers
The __________ backup method is based on the philosophy that a full backup should occur at regular intervals, such as monthly or
kaheart [24]

Answer:

full/incremental backup

Explanation:

I believe it's full/incremental backup.

7 0
2 years ago
Dr. Wisteria is a prominent chiropractor in the Chicago area. She wants to provide a forum for her patients to discuss their hea
Svet_ta [14]

The best-suited telecommunications tool for Dr. Wisteria is a blog.

a blog

<u>Explanation:</u>

A blog can be defined as an informational website and more a platform for exchanging views and ideas about a particular topic.

There are various blogging platforms available. Dr. Wisteria should start writing blogs about health issues and in this way, she would be able to interact with all the people accessing the blog. People can also post their queries about their health issues and Dr. Wisteria can always reply to them.

This would also create a lot of awareness about any particular health issue being discussed as it is not necessary that only those people who want to post something will access the blog post, it can always be accessed by anyone.

5 0
3 years ago
Read 2 more answers
A business wants to centralize its administrative tasks. At the same time, it wants the existing systems to manage and sustain t
asambeis [7]

Answer:

personal information management

Explanation:

In other to ensure that required information regarding basic tasks which are required, personal information management helps attain this seamlessly by systematically studying the activities which are being performed in other to or for task such as storing, retrieving, creation. Maintainance and organization of information. With personal information management, tasks are segmented and organized in a tidy and effective manner such that the right, complete and quality information is made available at all times in other to ensure that nothing is missed or lacking.

5 0
3 years ago
Read 2 more answers
Other questions:
  • To create a button that will allow a user to send the form data to the server you use a type of ____
    5·1 answer
  • You can access various sites on the WWW by using hyperlinks or by
    14·1 answer
  • Your company has recently been hired to install a smart security system for a large office building. The system will include sec
    12·1 answer
  • Discuss three ways you could (or currently do) use the Excel software in your personal or professional life. Provide examples an
    12·1 answer
  • ____ includes any attempt to intentionally conduct dishonest activities online.
    5·1 answer
  • HIPAA requires the following controls for medical records: A. Encryption of all data B. Technical safeguards C. Physical control
    12·1 answer
  • In this scenario, hackers launch cyber-attacks that affect several parts of the nationâs financial infrastructure over the cours
    8·1 answer
  • Need the answer ASAP!!!
    5·1 answer
  • I need help with this question.
    15·1 answer
  • Explain approaches of AI​
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!