Advertisement
jhnksr

3MAXV2

Sep 28th, 2023
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | Source Code | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.    
  6.     int a,b,c,n;
  7.     cout << "Enter three numbers: ";
  8.     cin >> a >> b >> c;
  9.     if ((a > b) && (a > c))
  10.      {
  11.         n = a;
  12.     }
  13.     else if ((b > a) && (b > c))
  14.     {
  15.         n = b;
  16.     }
  17.     else if ((c > a) && (c > b))
  18.     {
  19.         n = c;
  20.     }
  21.    
  22.     cout << "The maximum number between the three is: " << n <<".";
  23.     return 0;
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement