KDT85

Untitled

Oct 13th, 2022
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     cout << "Enter two numbers: " << endl;
  7.     int num1 = 0, num2 = 0;
  8.     cin >> num1;
  9.     cin >> num2;
  10.  
  11.     int max = (num1 > num2) ? num1 : num2; // what is going on here, somekind of list comprehension
  12.     cout << "The greater number is: " << max << endl;
  13.  
  14.     return 0;
  15. }  
Advertisement
Add Comment
Please, Sign In to add comment