Advertisement
Guest User

Untitled

a guest
Sep 19th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.53 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. double a;
  6. double b;
  7. double c;
  8.  
  9. int main()
  10. {
  11.     cout << "Please enter three numbers: ";
  12.     cin >> a >> b >> c;
  13.    
  14.     if (a >= b && a>= c)
  15.     {
  16.         cout << a << " is the largest number" << endl;
  17.         return 0;
  18.     }
  19.    
  20.     if (b >= a && b >= c)
  21.     {
  22.         cout << b << " is the largest number" << endl;
  23.         return 0;
  24.     }
  25.    
  26.     else if (c >= a && c >= b)
  27.     {
  28.         cout << c << " is the largest number" << endl;
  29.         return 0;
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement