program to check smallest num in three numbers in c 2b 2b

Solutions on MaxInterview for program to check smallest num in three numbers in c 2b 2b by the best coders in the world

showing results for - "program to check smallest num in three numbers in c 2b 2b"
Juan Esteban
26 Nov 2018
1#include <iostream>
2using namespace std;
3
4int main() {
5 
6    int a, b, c;
7 
8    cout << "Enter three numbers \n";
9
10    /* Taking input */
11    cin >> a >> b >> c;
12 
13    /* If a is smaller than b and c. */
14
15    if (a < b && a < c) {
16        cout << "Smallest number is " << a;
17
18      /* If b is smaller than a and c */
19    } else if (b < a && b < c)  {
20       cout << "Smallest number is " << b;
21
22    } else {
23      cout << "Smallest number is "<< c;
24
25     }
26 
27      return 0;
28}
29