Computer Science, asked by sydnieaverette, 4 months ago

Write a program whose input is two integers. Output the first integer and subsequent increments of 5 as long as the value is less than or equal to the second integer.
Ex: If the input is:
-15
10
The output is:
-15 -10 -5 0 5 10
Ex: If the second integer is less than the first as in:
20
5
the output is:
Second integer can't be less than the first.
For coding simplicity, output a space after every integer, including the last.

Answers

Answered by tamilselvisozhan
0

leave a reply cancel reply I was wondering

Answered by StockJanitor
0

Answer:

a = int(input())

b = int(input())

if a<=b:

   while a<=b:

       print(a, end = ' ')

       a += 5

       continue

else:

   print('Second integer can\'t be less than the first.')

Explanation:

a and b are two input

if a <= b, and while a <= b

we iterate the while statement to print the outcomes and end with space and next one until it stops

else:

print the second int cannot be less than first.

Similar questions