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
A technician receives an invalid certificate error when visiting a website with port 443 enabled. Other computers on the same LA
amm1812

Answer:

Option (A) is the right answer.

Explanation:

According to the scenario, the user system is giving the error of invalid certificate while other users on the same network do not report any error, which means that there is some problem in a particular system.

Date and time can also be one of the main cause of this error because wrong date and time creates problem in surfing many websites by giving certificate error.

Hence the most appropriate answer is option (A).

While other option are wrong because of the following reasons:

  • UEFI boot mode is mainly used in booting the operating system and has no connection with network.
  • Logon time is also wrong because if the problem is with the login server, it can not give certificate error.
  • User access control is also not correct because it is used to control the access of the user.
7 0
3 years ago
Which of the following is not a component of Google Display ads' value proposition?
Evgesh-ka [11]

Answer:

D. Search.

Explanation:

Google search engine is a engine used in browsers to seek of information related to the search values inputted by the user. This search engine is used in varieties of browsers like google chrome, mozilla firefox, phoenix etc, this is because it has a wide range of Google community web servers to get information.

Google Display ads value proposition is an advertising platform that takes advantage of the enormous google community on the internet of advertise client products and services across thousands of websites.

It uses the intent of the costumer, machine learning and performance of a website to advertise products, it does not need a search component since it is advertised automatically on an active website.

6 0
3 years ago
Answer this crossword for brainliest and 15 points
nordsb [41]

Answer:

I like ur cut G

Explanation:

6 0
3 years ago
Which of the following is NOT a unit used to measure temperature?
Trava [24]
Watt is used to measure electricity. Fahrenheit is mostly used in the US for temp. Celsius is used everywhere else for temp. And C and kelvin are used scientifically for temp :)
3 0
3 years ago
Why is brainly not working it say im logged out rn but im not i cant acces anything but this
Grace [21]

Answer:

the answers are unlimited now so you cant sigh up but if you cant log in then one of the things you filled i. Might be wrong

Explanation:

3 0
4 years ago
Read 2 more answers
Other questions:
  • If you were asked to subnet a network in such a way as to arrive at 6 network ids you would need to borrow 2 bits.
    7·1 answer
  • Which directory in the FHS stores programs and configuration information that can only be executed and modified by the root user
    10·1 answer
  • Which of the following parameters should match in order for a pair of routers to form an adjacency when running OSPFv2? (Points
    9·1 answer
  • Send answer below, Thank you
    8·1 answer
  • According to the presentation, integrity and ethics are particularly important for careers in which of the following pathways?
    5·1 answer
  • Suppose that the domestic production of computer games creates enjoyment for those who play the games. Domestic production of co
    14·1 answer
  • Type of file containing instructions that tell your computer how to perform ___
    9·1 answer
  • Although it is not a term Excel uses, how do most people think of Excel?
    13·1 answer
  • What is CPU ????....................​
    7·2 answers
  • 1. Give one reason why data is represented in binary in a computer [1]
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!