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
valentinak56 [21]
3 years ago
9

Consider this program segment: int newNum = 0, temp; int num = k; // k is some predefined integer value 0 while (num > 10) {

temp = num % 10; num /= 10; newNum = newNum * 10 + temp; } System.out.println(newNum); Which is a true statement about the segment? I If 100 <= num <= 1000 initially, the final value of newNum must be in the range 10 <= newNum <= 100. II There is no initial value of num that will cause an infinite while loop. III If num <= 10 initially, newNum will have a final value of 0.
Computers and Technology
1 answer:
Doss [256]3 years ago
6 0

Answer:

All of these statements are true.

Explanation:

Since the while loop is reversing the integer number and leaving the highest order digit in the num and stores the reversed number in the newNum variable.

It skips one digit so if the num is in the range of [100,1000] it will result in a number between 10 and 100.

This loop can never go in infinite loop for any initial value of num because the loop will run as many times as the number of digits.

and if the value of the num is <=10 the while loop will never run and the value of newNum will be 0.

You might be interested in
Why might a peer-to-peer network not be the best choice for a large corporate office setting?
omeli [17]

Answer:

a it is less private

Explanation:

8 0
3 years ago
What does this loop that uses a range function do? for i in range(7, 15): print("goodbye") It prints "goodbye" 8 times, numbered
goldfiish [28.3K]

Answer:

It prints "goodbye" 8 times.

Explanation:

The loop being described in this scenario would print "goodbye" 8 times. It would not include numbers detailing the range since the loop instructions only state for the system to print("goodbye") and nothing else. Also, it would only print it 8 times because in a range the endpoint is not included, this is mainly because in programming data structures tend to run on 0-based indexing.

6 0
2 years ago
Read 2 more answers
Minerals can form deep inside Earth’s crust by
ipn [44]

ANSWER:

Minerals can form deep inside earth's crust by the crystallization of melted materials. There are two ways on how minerals are formed: crystallization of melted materials and the crystallization of materials dissolved in water.

Hope this helps!

5 0
2 years ago
Is October tornado season?
Reptile [31]
No October is not tornado season
5 0
3 years ago
Read 2 more answers
PLEASE-I'M STUCK!!!!!!!!!!!!!!!!!!!!!!
Blababa [14]

Answer: Input is the answer.

8 0
2 years ago
Other questions:
  • Wendy Patel is entering college and plans to take the necessary classes to obtain a degree in architecture. Research the program
    12·1 answer
  • Mr. Yang is a doctor who regards video games as an effective means of staying fit. What type of game would he recommend to his p
    11·2 answers
  • What is an independent data mart?
    8·1 answer
  • Who's better Kapkan or Tachanka?
    6·1 answer
  • What technology allows data to be stored in one place and be retrieved by many systems?
    7·1 answer
  • Using the _______ list, you can select the number of photos that will appear on each slide.
    13·1 answer
  • In DTP, a good rule of thumb is to use as many special effects as you need to make your documents look interesting.
    5·1 answer
  • What's the best strategy for avoiding ATM fe
    14·1 answer
  • Jonathan is in the process of creating a photo of a fluttering flag with cars moving around in the background. He wants the flag
    13·2 answers
  • How do I do this??? (Im in 9th)
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!