Solution for Member Initializers In c++
Member Initializers You are making a program to store TVs with their width and height. The given program declares a TV class with height and width members, an area() method, as well as a constructor that initializes the members of the class. Complete the program by taking 2 integers as input, create a TV object by passing them to the constructor, and call the area() method. Note, that the constructor needs 2 integer values. solve: ------- // TITLE: test.cpp #include<bits/stdc++.h> #include <iostream> using namespace std; typedef long long ll; typedef long double ld; void solve(){ std::vector<char> v; } class A { int l,b,area; public: void rectangle(){ cin>>l>>b; cout<<l*b; } }; int main() { ios::sync_with_stdio(0); A obj; obj.rectangle(); return 0; }