338,414 views
1 vote
1 vote
Write a program whose input is two integers. Output the first integer and subsequent increments of 10 as long as the value is less than or equal to the second integer. Ex: If the input is: -15 30 the output is: -15 -5 5 15 25

User DustinB
by
3.0k points

2 Answers

15 votes
15 votes

Final answer:

The question asks for a high school level Computers and Technology program that outputs increments of 10 from a starting integer up to a maximum integer.

Step-by-step explanation:

The subject of the question is concerning writing a computer program. Specifically, the program is expected to output a series of numbers, starting with an initial integer and incrementing by 10 until it reaches or exceeds a second given integer. This question falls under the Computers and Technology category and targets the skills of programming logic and loops, which are topics usually covered at the high school level.

Here's an example of how one might design the program in Python:

first_num = int(input())
second_num = int(input())
while first_num <= second_num:
print(first_num)
first_num += 10

This simple program uses a while loop to repeatedly add 10 to the first number until the condition is no longer true (first number is less than or equal to the second number).

25 votes
25 votes

Answer:

Step-by-step explanation:

The following program is written in Python. It asks the user for two number inputs. Then it creates a loop that prints the first number and continues incrementing it by 10 until it is no longer less than the second number that was passed as an input by the user.

number1 = int(input("Enter number 1: "))

number2 = int(input("Enter number 2: "))

while number1 < number2:

print(number1)

number1 += 10

Write a program whose input is two integers. Output the first integer and subsequent-example-1
User Sonarholster
by
2.7k points