What is the total area of Punjab Province?

What is the result of the given code? #include #include class A{ public: A(int n): m_n(n) {if(0==n) {throw std::logic_error(“0”); } } ~A(){std::printf(“%d”,m_n);} public: const int m_n; }; int main() { try{ A a(1); A b(0); A c(2); } catch (const std::exception &) { std::cout<<3;} std::cout<





Answer Detail

#include #include class A{ public: A(int n): m_n(n) {if(0==n) {throw std::logic_error("0"); } } ~A(){std::printf("%d",m_n);} public: const int m_n; }; int main() { try{ A a(1); A b(0); A c(2); } catch (const std::exception &) { std::cout<<3;} std::cout<<std::endl; return 0; }

Leave a Comment

Your email address will not be published. Required fields are marked *