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
nikklg [1K]
3 years ago
12

Consider the following code segment.

Computers and Technology
1 answer:
mafiozo [28]3 years ago
7 0

Answer:

for (int h = k; h >= 0; h--)

Explanation:

From the list of given options, option C answers the question.

In the outer loop

Initially, k = 0

In the inner loop,

h = k = 0

The value of h will be printed once because h>=0  means 0>=0 and this implies once

To the outer loop

k = 1

The inner loop will always assume value of k;

So,

h = 1

This will be printed twice because of the condition h>=0  means 1>=0.

Since 1 and 0 are >=0; 1 will be printed twice

To the outer loop

k = 2

The inner loop

h = 2

This will be printed thrice because of the condition h>=0  means 2>=0.

Since 2, 1 and 0 are >=0; 2 will be printed thrice

To the outer loop

k = 3

The inner loop

h = 3

This will be printed four times because of the condition h>=0  means 3>=0.

Since 3, 2, 1 and 0 are >=0; 3 will be printed four times

You might be interested in
Which is true regarding pseudocode?
drek231 [11]

Answer:

It uses simple words and symbols to communicate the design of a program.

Explanation:

4 0
2 years ago
Read 2 more answers
Help Me Please. I'm Begging you
Luba_88 [7]

Answer:

d and b can't see the last ones answer so im guessing this is what you needed.

Explanation:

8 0
2 years ago
Can someone please tell me how can I code this onto C# on Visual Studio 2019? It’s due tomorrow!!
11111nata11111 [884]

Answer:

i need points

Explanation:

lol

8 0
3 years ago
Which of the following would not count toward a weighted GPA?
marta [7]
D AP music theory is the answer
7 0
3 years ago
Read 2 more answers
Suppose we have a String object called myString. Write a single line of Java code
VikaD [51]

Answer:

myString=myString.toUpperCase();

Explanation:

In java to change all characters of a string to upper case we use .toUpperCase() method.It will convert string to upper case.

Implementation in java.

import java.util.*;

class Solution

{

public static void main (String[] args) throws java.lang.Exception

{

   try{

Scanner scr=new Scanner(System.in);

System.out.print("Enter a string:");

String myString=scr.nextLine();

myString=myString.toUpperCase();

System.out.println("string in upper case : "+myString);

         }catch(Exception ex){

       return;}

}

}

Output:

Enter a string:hello

string in upper case : HELLO

5 0
3 years ago
Other questions:
  • Assume that a gallon of paint covers about 350 square feet of wall space. Create an application with a main() method that prompt
    9·1 answer
  • This type of connection is best to use when downloading large files on a network.
    10·1 answer
  • Media applications that play audio or video files are part of a class of workkloads called "streaming" workloads (i.e., they bri
    9·1 answer
  • Write a program second.cpp that takes in a sequence of integers, and prints the second largest number and the second smallest nu
    7·1 answer
  • What is one requirement for achieving Continuous Deployment
    15·2 answers
  • Which is the best information to determine an athlete's abilities and needed areas of improvement?
    12·2 answers
  • Which Application program saves data automatically as it is entered?
    10·1 answer
  • The excerpt is a sample works-cited list.
    5·2 answers
  • Have some points part 6<br>anyone know how to change my username?​
    11·2 answers
  • failed logins or instances of denial of access to restricted files may be indicators of compromise. suggest where records of suc
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!