fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int i;
  8. int j;
  9.  
  10. cin >> i;
  11. cin >> j;
  12.  
  13. if (i>0)
  14. cout << "i is greater than 0" << endl;
  15.  
  16. if (i>0)
  17. {
  18. if (j>0)
  19. cout << "i and j are both greater than 0" << endl;
  20. else
  21. cout << "i is greater than 0 but j isn't" << endl;
  22. }
  23. else
  24. cout << "i is not greater than 0" << endl;
  25.  
  26. return 0;
  27. }
Success #stdin #stdout 0.01s 2684KB
stdin
5
-2
stdout
i is greater than 0
i is greater than 0 but j isn't