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
Which boolean operator (and, not, or or) gives you the least results? *?
Readme [11.4K]
And, as it only includes results with just both terms. Or will give either and not will give everything but.
6 0
3 years ago
In the past, data was transferred from OTLP databases to data warehouses periodically, say once a month or even once a week. Now
Vinvika [58]

Answer:

Active is the correct answer of this question.

Explanation:

In active database is a database that contains a tournament-driven infrastructure that can adjust to circumstances within the database and beyond. Alternate  include safety tracking, contacting, collecting and approving information.A move is towards active or real-time data storage so that applications can evaluate and help decision making use of current data.

3 0
4 years ago
You are designing a wireless network for a client. Your client needs the network to support a data rate of at least 54Mbps. In a
mariarad [96]

Answer:

The best choice is 802.11a.

Explanation:

The most common option, that is widely used in home internet is 802.11b, however, this only supports a max speed of 11Mbps.

802.11a supports up to 54Mbps and it has regulated frequencies that prevent interference from other devices, such as the wireless system that your client already has. This option is more expensive, and its signal has issues going through walls and rooms but still, it is the one that fits him the most.

4 0
3 years ago
Identify disadvantages that web designers encountered when using tables for page layout. Check all of the boxes that apply.
11Alexandr11 [23.1K]

Answer:

A and C

Explanation:

I got the question correct on Edge.

7 0
3 years ago
Read 2 more answers
What is a computer memory <br>​
Alex_Xolod [135]

Answer:

In computing, memory is a device or system that is used to store information for immediate use in a computer or related computer hardware and digital electronic devices. The term memory is often synonymous with the term primary storage or main memory. An archaic synonym for memory is store.

5 0
3 years ago
Read 2 more answers
Other questions:
  • 1.using synonyms can help make ur writing more________
    11·1 answer
  • An installed theme can be applied by clicking on a theme in the themes group on the ____ tab.
    7·2 answers
  • Sharon is responsible for the security on web applications. She’s looking to see if all applications have input validation. What
    12·1 answer
  • Sometimes your Internet is slow and sluggish, what are some common problems that affect network functionality. Check all that ap
    14·1 answer
  • Eric is working on a computer that has a device driver error. Eric can find the name of the device driver however the actual dev
    13·2 answers
  • Translate each of the following binary representations into its equivalent base ten representation.
    7·1 answer
  • PLEASE HELP ME FIX THIS CODE.
    10·1 answer
  • Weird canvas submission, I’ve done directly what the directions say to do to submit it, but it won’t submit
    15·1 answer
  • Cho 1 biến x thuộc kiểu dữ liệu Integer , hãy cho biết biến x dùng để làm gì?
    7·1 answer
  • Select the correct answer.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!