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
# include <iostream>
// function that finds the smallest of two integers
int min(int a, int b) { return ((a < b) ? a : b); }
int main() {
int a, b, c;
std::cin >> a >> b >> c;
std::cout << min(min(a, b), c);
}
Comments
Leave a comment