Which of the following is the output of the following C++ code segment in Dev…
PYQ DSSSB 2022
Which of the following is the output of the following C++ code segment in Dev C++ under Windows 10 operating system?
#include <iostream>
using namespace std;
class A {
int a = 10, b = 20;
A(int a, int b) { a = 30; b = 40; }
public:
A() {
A x(50, 60);
cout << "a=" << a << " b=" << b;
}
};
int main() {
A y;
}- A.
a=30 b=40
- B.
a=10 b=20
- C.
a=50 b=60
- D.
a=10 b=60
Attempted by 862 students.
Sign up free to check your answer
Sign up freeLoading lesson…

