fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. try
  7. {
  8. int a=65539;
  9. cout<<"\nWhat is lesser than five?\n";
  10. if (a>=5) throw a;
  11. }
  12. catch (int e)
  13. {
  14. cout<<"\nWrong!\n" << e;
  15. return 0;
  16. }
  17. cout<<"\nCorrect!\n";
  18. return 0;
  19. }
Success #stdin #stdout 0s 4296KB
stdin
Standard input is empty
stdout
What is lesser than five?

Wrong!
65539