Get the answers you need at Westonci.ca, where our expert community is dedicated to providing you with accurate information. Connect with a community of experts ready to help you find solutions to your questions quickly and accurately. Get detailed and accurate answers to your questions from a dedicated community of experts on our Q&A platform.

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

Sagot :

Answer:

The  program in Python is as follows:

nums = []

for i in range(3):

   num = int(input(""))

   nums.append(num)

   

print(min(nums))

Explanation:

This initializes a list of numbers

nums = []

This loop is repeated 3 times

for i in range(3):

For each repetition, this prompts the user for input

   num = int(input(""))

This appends the input to the list

   nums.append(num)

This gets the smallest of the three inputs using the min() function. The smallest is also printed

print(min(nums))

The Answer is in Bold:

#include <iostream>

using namespace std;

int main() {

 

  int  a, b, c;      //NOTE: you don't have to put a, b, c. you can put it as x, y, z

                                       //or you can make it as num1, num2, num3 etc.

  cin >> a;        

  cin >> b;

  cin >> c;

 

  if (a < b && a < c)   {            

     cout << a <<endl;              

  }                                                    

  else if(b < a && b < c)   {      

     cout << b << endl;

  }

  else   {

     cout << c <<endl;

  }    

  return 0;

}

We appreciate your time. Please revisit us for more reliable answers to any questions you may have. Thank you for your visit. We're committed to providing you with the best information available. Return anytime for more. Westonci.ca is your go-to source for reliable answers. Return soon for more expert insights.