Write a program that reads three numbers and prints their minimum.
Input: Input consists of three different integer numbers.
Output : Print a line with the minimum of the three numbers.
Input: Input consists of three different integer numbers.
Output : Print a line with the minimum of the three numbers.
#include <iostream> using namespace std; int main() { int l, m, n; cin >> l >> n >> m; if (n < l and n < m) cout << n << endl; else if (m < n and m < l) cout << m << endl; else cout << l << endl; }
No comments:
Post a Comment