Advertisement
jhnksr

If Else Example

Sep 28th, 2023
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | Source Code | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.     int num;
  6.     cout << "Enter a number: ";
  7.     cin >> num;
  8.  
  9.         if (num>100)
  10.     {
  11.             cout << "You have entered " << num << ", and it is greater than 100";
  12.     }
  13.  
  14.         else
  15.     {
  16.             cout << "You have entered " << num << ", and it is less than 100";
  17.     }
  18.     return 0;
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement