How can sololearn be so bad teaching the use of exceptions in c++?
First it's a shame to talk about exceptions and to throw only integers. At least throw an std::exception or std::runtime_exception. Then throwing and handling exceptions in the same function defeat the purpose of using exceptions. A good exemple would be to start with a function printing the division of two integers and using error codes to handle the divided by 0 error. Then explaining that if you want to return the result you cannot. And introduce exceptions and explain their advantages.