Constructor Destructor (intake 41 section 2)

Question

Debug the following program carefully and show what will be the output of the following code?
#include<iostream>
using namespace std;
class Example {
    public:
void ~Example()
{
cout<<“Destroying the object”;
}
};
int main()
{
Example Ex;
return 0;
}

in progress 0
Ask me anything 2 months 19 Answers 173 views 0

Answers ( 19 )

  1. Name:Md.Emon Ali

    ID:154

    #include<iostream>
    using namespace std;
    class Example
    {
    public:
    ~Example()
    {
    cout<<“Destroying the object”;
    }
    };
    int main()
    {
    Example Ex;
    return 0;
    }

    output

    Destroying the object

  2. Name: Arman Hossain

    Id:18192103156

    Section:04

    #include<iostream>
    using namespace std;
    class Example
    {
    public:
    ~Example()
    {
    cout<<“Destroying the object”;
    }
    };
    int main()
    {
    Example Ex;
    return 0;
    }

    output

    Destroying the object

  3. #include<iostream>
    using namespace std;
    class Example
    {
    public:
    ~Example()
    {
    cout<<“Destroying the object”;
    }
    };
    int main()
    {
    Example Ex;
    return 0;
    }

    output

    Destroying the object

  4. Name:Nigar sultana Era

    Id:175

    Sec:4

    #include<iostream>
    using namespace std;
    class Example
    {
    public:
    ~Example()
    {
    cout<<“Destroying the object”;
    }
    };
    int main()
    {
    Example Ex;
    return 0;
    }

    output

    Destroying the object

  5. Name: Rakibul Hasan Shafin

    ID: 18192103165

    Intake: 41

     

    #include<iostream>
    using namespace std;
    class Example
    {
    public:
    ~Example()
    {
    cout<<“Destroying the object”;
    }
    };
    int main()
    {
    Example Ex;
    return 0;
    }

    output

    Destroying the object

  6. Name: Rumman

    Id:18192103138

    Section:04

    #include<iostream>
    using namespace std;
    class Example
    {
    public:
    ~Example()
    {
    cout<<“Destroying the object”;
    }
    };
    int main()
    {
    Example Ex;
    return 0;
    }

    output

    Destroying the object

  7. Name: Tahmid Hossain  Rasel

    Id:18192103168

    Section:04

    #include<iostream>
    using namespace std;
    class Example
    {
    public:
    ~Example()
    {
    cout<<“Destroying the object”;
    }
    };
    int main()
    {
    Example Ex;
    return 0;
    }

    output

    Destroying the object

  8. Name: Tabassum Mehrin prova

    ID:  177

    #include<iostream>
    using namespace std;
    class Example
    {
    public:
    ~Example()
    {
    cout<<“Destroying the object”;
    }
    };
    int main()
    {
    Example Ex;
    return 0;
    }

    output

    Destroying the object

  9.  

    Name: Tamanna Tasnim

    ID: 142

     

    #include<iostream>
    using namespace std;
    class Example
    {
    public:
    ~Example()
    {
    cout<<“Destroying the object”;
    }
    };
    int main()
    {
    Example Ex;
    return 0;
    }

    output

    Destroying the object

  10. Name:Shamima Akter Shimu Id:18192103144 sec:4

    #include<iostream>
    using namespace std;
    class Example
    {
    public:
    ~Example()
    {
    cout<<“Destroying the object”;
    }
    };
    int main()
    {
    Example Ex;
    return 0;
    }

    output

    Destroying the object

  11. Md.Muntasir Mamun

    ID:18192103179

    Intake:41  Sec:4

    #include<iostream>
    using namespace std;
    class Example
    {
    public:
    ~Example()
    {
    cout<<“Destroying the object”;
    }
    };
    int main()
    {
    Example Ex;
    return 0;
    }

    output

    Destroying the object

  12. Name:Sanjara

    Id:18192103166

    Sec:04

    #include<iostream>
    using namespace std;
    class Example
    {
    public:
    ~Example()
    {
    cout<<“Destroying the object”;
    }
    };
    int main()
    {
    Example Ex;
    return 0;
    }

    output

    Destroying the object

  13. MD Ashraful Hossain

    Intake -41    Section-4

    ID-18192103137

     

    #include<iostream>
    using namespace std;
    class Example
    {
    public:
    ~Example()
    {
    cout<<“Destroying the object”;
    }
    };
    int main()
    {
    Example Ex;
    return 0;
    }

    Output :

    Destroying the object.

  14. ID:18192103149

    include<iostream>
    using namespace std;
    class Example
    {
    public:
    ~Example()
    {
    cout<<“Destroying the object”;
    }
    };
    int main()
    {
    Example Ex;
    return 0;
    }

    output

    Destroying the object

  15. Name : Masudul Islam Asif

    ID NO : 18192103147

    Intake : 41

    Sec : 4

     

    #include<iostream>
    using namespace std;
    class Example
    {
    public:
    ~Example()
    {
    cout<<“Destroying the object”;
    }
    };
    int main()
    {
    Example Ex;
    return 0;
    }

  16. Arup Raton Chowdhury

    ID:18192103155

    Intake:41  Sec:4

    #include<iostream>
    using namespace std;
    class Example
    {
    public:
    ~Example()
    {
    cout<<“Destroying the object”;
    }
    };
    int main()
    {
    Example Ex;
    return 0;
    }

    output

    Destroying the object

  17. Sorry it a private answer.

  18. D.K.Shah Alam
    iD.18192103176
    intake:41,sec:4
    #include
    using namespace std;
    class Example {
    public:

    ~Example()
    {
    cout<<"Destroying the object";
    }
    };
    int main()
    {
    Example Ex;
    return 0;
    }

    output

    Destroying the object

Leave an answer