217k views
1 vote
4.7 code practice question 2 edhesive i cant figure out the code for this problem csn anyone help me?

User Patfreeze
by
5.9k points

1 Answer

5 votes

Answer:

See Explanation

Step-by-step explanation:

See attachment for complete question

The programming language is not stated; I'll answer using Python and Java

Python:

low = 56

high = 70

for i in range(low,high+1):

print(i)

Java:

public class PrintOut{

public static void main(String [] args)

{

int low = 56; int high = 70;

for(int i = low; i<=high;i++)

System.out.print(i+" ");

}

}

For both codes, the explanation is:

The code starts by initializing the range of the print out to 56 and 70

Next, the code segment used an iteration that loops through 56 and 70 and print each digit in this range (both numbers, inclusive).

4.7 code practice question 2 edhesive i cant figure out the code for this problem-example-1
User Hobberwickey
by
5.5k points