Write a program whose inputs are three integers, and whose output is the smallest of the three values. Ex: If the input is: 7 15 3 the output is: 3
Write a program whose inputs are three integers, and whose output is the smallest of the three values. Ex: If the input is: 7 15 3 the output is: 3
Chapter8: Arrays
Section: Chapter Questions
Problem 5GZ
Related questions
Question
Write a program whose inputs are three integers, and whose output is the smallest of the three values.
Ex: If the input is:
7 15 3
the output is:
3
I have most of the solution. I cannot figure out the answer if I input :
7 7 7..
My solution shows no output but the expected output is supposed to be a single 7
![main.py
Load default template...
1 a=int(input();
2 b=int(input();
3 c=int(input();
#Input the value of a
#Input the value of b
#Input the value of c
4
5 if(a<b and a<c):
print(a);
7 elif(b<a and b<c):
print(b);
9 elif(c<a and c<b):
print(c);
6.
#if a is less than b and c
8
#if b is less than a and c
10
#if c is less than a and b
Run your program as often as you'd like, before submitting for grading. Below, type any needed
input values in the first box, then click Run program and observe the program's output in the
Develop mode
Submit mode
second box.
Enter program input (optional)
7
7
7
main.py
(Your program)
Run program
Input (from above) –
Output (shown below)
Program output displayed here
(Your program produced no output)
↑](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F0fb6fbe8-c93b-4e2e-8100-eedf21471e21%2F5ea6e084-a3b4-4635-92d5-b9b733404832%2F9xs8ua5_processed.png&w=3840&q=75)
Transcribed Image Text:main.py
Load default template...
1 a=int(input();
2 b=int(input();
3 c=int(input();
#Input the value of a
#Input the value of b
#Input the value of c
4
5 if(a<b and a<c):
print(a);
7 elif(b<a and b<c):
print(b);
9 elif(c<a and c<b):
print(c);
6.
#if a is less than b and c
8
#if b is less than a and c
10
#if c is less than a and b
Run your program as often as you'd like, before submitting for grading. Below, type any needed
input values in the first box, then click Run program and observe the program's output in the
Develop mode
Submit mode
second box.
Enter program input (optional)
7
7
7
main.py
(Your program)
Run program
Input (from above) –
Output (shown below)
Program output displayed here
(Your program produced no output)
↑
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
![C++ for Engineers and Scientists](https://www.bartleby.com/isbn_cover_images/9781133187844/9781133187844_smallCoverImage.gif)
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781305480537/9781305480537_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
![C++ for Engineers and Scientists](https://www.bartleby.com/isbn_cover_images/9781133187844/9781133187844_smallCoverImage.gif)
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781305480537/9781305480537_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT