Advertisement
jhnksr

3MAX

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