102k views
4 votes
Write a program using integers userNum and divNum as input, and output userNum divided by divNum three times.

Ex: If the input is:
2000 2
the output is:
1000 500 250

User Xxdesmus
by
7.0k points

1 Answer

6 votes

Answer:

Here is a program that takes two integers as input, divides the first by the second, and prints the result three times:

# get user input for userNum and divNum

userNum = int(input("Enter userNum: "))

divNum = int(input("Enter divNum: "))

# divide userNum by divNum three times and print the result

result = userNum / divNum

print(result)

result = result / divNum

print(result)

result = result / divNum

print(result)

Example output:

Enter userNum: 2000

Enter divNum: 2

1000.0

500.0

250.0

Step-by-step explanation:

User Mohammad Falahat
by
6.6k points