#include <iostream>
using namespace std;

class Sensor {
public:

      // your code here: define constructor taking int id and printing "Sensor <id> initialized"
      Sensor(int id): id(id)
      {
            std::cout << "Sensor " << id << " initialized\n";      
      }
private:
      int id;
};

int main() {
   Sensor s(101);
   return 0;
}
Upvote
Downvote
Loading...

Input

Expected Output

Sensor 101 initialized