#include <iostream>class Base{public:Base ( ){cout << "5" << endl;}~Base ( ){cout << "9" << endl;}};class Derived : public Base{public:Derived ( ){cout << "1" << endl;}~Derived ( ){cout << "8" << endl;}};int main( ){Derived x;}
#include <iostream>#include <string>#include <cstdlib>using namespace std;template<class G>G func(G x){cout<<x;return x;}int func(int x){cout<<x;}int main(int argc, char const *argv[]){int x = 2;int y = func(x);float z = func(2.2);return 0;}
What will be the output of the following Python code?l=[1, 0, 2, 0, 'hello', '', []]list(filter(bool, l))