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
VikaD [51]
2 years ago
8

Write a program whose inputs are two integers, and whose output is the smallest of the two values.

Computers and Technology
1 answer:
andrezito [222]2 years ago
8 0

Method 1 :

Using If else statements: If the condition checks whether num1 is smaller than num2 if so it will print 'Smallest of these two integers is num1'.

else it will print 'Smallest of these two integers is num2'

Method 2:

Using the 'min' method: using the method min(num1,num2), the program finds the smallest value and prints it directly to the user.

Python Program using method 1

#PYTHON PROGRAM TO FIND SMALLEST INTEGER VALUE FROM TWO INPUTS FROM USER - Method 1

#Accepts inputs from user

num1 = int (input ("Enter your first number:")) #Gets the first integer input from user and stores in num1

num2 = int (input ("Enter your second number: ")) #Gets the second integer input from user and stores in num2

#Finding output by if else

#Checks num1 smaller than num2

if (num1 < num2):

#assign num1 to small

small = num1

else:

#assign num2 to small

small = num2

 

print ("Smallest of these two integers is", small)

Python Program using method 2

#PYTHON PROGRAM TO FIND SMALLEST INTEGER VALUE FROM TWO INPUTS FROM USER - Method 2

#Accepts inputs from user

num1 = int (input ("Enter your first number:")) #Gets the first integer input from user and stores in num1

num2 = int (input ("Enter your second number: ")) #Gets the second integer input from user and stores in num2

#Finding output using min method

print("\n Smallest of these two integers is",min(num1,num2)) #Prints output to user

You might be interested in
Jason Is Working On A Video Science Project. As He Is Working On It, He Saves The Project.
zubka84 [21]
I think the problem here is either you don't have enough space and power to run this with your file or the file its self is too large if that's not the case try to google it and look for techisky for help
7 0
4 years ago
Show the printout of the following code.
alexira [117]

Answer:

E. 7.0

Explanation:

the 7 of the out of the older and make a shame of waves and force of trying

7 0
3 years ago
What is the purpose of a computer virus? O to spread a disease to humans O to substitute for a human disease a O to disrupt a co
Ivahew [28]

Answer:

to disrupt a computer

Explanation:

3 0
3 years ago
Python 3 please hurry!!
user100 [1]

Answer:

Explanation:

6 0
3 years ago
if the input message is omitted when creating a data validation rule for a cell, no message will appear when the user selects th
pochemuha

Answer:

True.

Explanation:

If the input message is omitted when creating a data validation rule for a cell, no message will appear when the user selects the cell. Data validation rules are used to define the type of data that can be entered into a cell, and the input message is an optional feature that allows you to provide a custom message to the user when they select the cell. If the input message is not specified, no message will be displayed when the user selects the cell.

6 0
1 year ago
Other questions:
  • The term used to describe an electronic device, operating under the control of instructions stored in its own memory, that can a
    7·1 answer
  • You are attempting to open a file containing a list of integer numbers, each on a separate line, and read them into Python as in
    6·1 answer
  • You are troubleshooting an IEEE 802.11 wireless client device that cannot connect to the wireless network. You notice the client
    14·1 answer
  • Design an application that has an array of at least 20 integers. It should call a module that uses the sequential search algorit
    13·1 answer
  • How do I write a letter on my computer and print it?
    9·2 answers
  • Consider the markets for monitors, USB drives, central processing units, and Microsoft’s Windows. Assume monitor manufacturers u
    7·1 answer
  • A posting error is:
    8·1 answer
  • Design a class named Person with fields for holding a person’s name, address, and telephone number. Write one or more constructo
    12·1 answer
  • Help mah!!! T^T please and thank you mate
    5·2 answers
  • Write a query that returns the first name of a student whose last name is "Patil" and is in the Ravenclaw house.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!