Home / MCQ Bank / Computer
Computer Constructors And Destructors In C Plus Plus Difficulty: Medium

What will be the output of the following C++ code? #include <iostream> using namespace std; class A{ ~A(){} }; class B { public: A a; }; int main(int argc, char const *argv[]) { B b; return 0; }

Select the correct option to test your answer:

More Computer Questions

What is the purpose of the 'strtok()' function in C++? Human beings are referred to as Homosapiens, which device is called Sillico Sapiens? What will be the output for the given code? #include <stdio.h> #include <stdbool.h> bool func1(int arr[], int n, int sum) { if (sum == 0) return true; if (n == 0 && sum != 0) return false; if (arr[n-1] > sum) return func1(arr, n-1, sum); return func1(arr, n-1, sum) || func1(arr, n-1, sum-arr[n-1]); } bool func (int arr[], int n) { int sum = 0; for (int i = 0; i < n; i++) sum += arr[i]; if (sum%2 != 0) return false; return func1 (arr, n, sum/2); } int main() { int arr[] = {4,6, 12, 2}; int n = sizeof(arr)/sizeof(arr[0]); if (func(arr, n) == true) printf("true"); else printf("false"); return 0; } Which of the following is the wrong statement about exception handling in C#.NET? The date and time displays on