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
denis23 [38]
2 years ago
4

LAB: Divide input integers

Computers and Technology
1 answer:
Brums [2.3K]2 years ago
7 0
Mark Brainliest please


Answer:
# The user is prompted to enter number as dividend
# The received number is assigned to userNum
userNum = int(input("Enter the number you want to divide: "))
# The user is prompted to enter number as divisor
# The divisor is assigned to x
x = int(input("Enter the number of times to divide: "))
# divideNumber function is defined to do the division
def divideNumber(userNum, x):
# counter is declared to control the loop
counter = 1
# the while-loop loop 3 times
# the division is done 3 times
while counter <= 3:
# integer division is done
# truncating the remainder part
userNum = userNum // x
# the result of the division is printed
print(userNum, end=" ")
# the counter is incremented
counter += 1
# the divideNumber function is called
# the received input is passed as parameter
# to the function
divideNumber(userNum, x)
# empty line is printed
print("\n")
Explanation:
The // operator in python works like the / operator in C. The // operator returns only the integer part of division operation. For instance 6 // 4 = 1. The fraction part is discarded
You might be interested in
Please help, I can't find the answer but I understand the topic.
gladu [14]

Answer:

x=(2+3)*3;

Explanation:

3 0
2 years ago
Read 2 more answers
Can someone answer this
finlep [7]
I really don’t know I need the points
6 0
2 years ago
Read 2 more answers
Ok this a computer question I downloaded a beta intel graphics driver and i am also installing ark editor from epic games but no
zmey [24]

Answer:

Uninstall the driver.

Explanation:

I would go to your File Explorer, This PC or My Computer, right click, and go up to manage. It would open up a Computer Management window. You would need to find Device Manager on the left. You would then see alot of devices. Find where it says, Display adapters, click on the little arrow to the left of it. If you see the driver, right click on it, and click uninstall. This also depends on what operating system you're using, and note, you've installed a beta driver, not a tested, fully working driver.

7 0
2 years ago
Read 2 more answers
Using for loop write an alogarithm flow program to find simple interest fo three steps? ​
ruslelena [56]

Answer:

The difference between a shallow and a deep depth of field is how much of your photo is in focus.

Explanation:

5 0
1 year ago
What is the likely long-term consequence of an increase in the relative percent of greenhouse gases in Earth’s atmosphere?
NemiM [27]

Answer:

Earth's average temperature will increase.

Explanation:

5 0
3 years ago
Other questions:
  • Can somebody explain me what this code does in a few or one sentence?#include #include using namespace std;int main () { const i
    12·1 answer
  • Select the correct answer.
    7·1 answer
  • Original Problem statement from the Text: A retail company must file a monthly sales tax report listing the sales for the month
    7·1 answer
  • Who invented the microwave oven in 1946 as an accidental by-product of wartime?
    7·1 answer
  • Which. Option tilts the image both horizantly and vertically be degrees
    5·1 answer
  • 9. Which is an example of a function?<br>(1 Point)<br>=A1 +A2<br>=SUM(A1:A3)<br>=ADD(A1:A3)​
    14·2 answers
  • Write a program that prompts the user to enter a month (1-12) and year, then displays the number of days in the month. For examp
    9·1 answer
  • What is your favorite anime ( All movies and episodes related to them count )
    8·2 answers
  • Different between I time and E time​
    12·1 answer
  • suppose that a system administrator at sls read the details of this case. what steps should he or she take to improve the compan
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!