All submissions

Object Declaration and Variable Access

#include <iostream>
using namespace std;

class Device {
public:
    int id;
    Device(int i)
    {
        id=i;
        std::cout<<"Device ID: "<<id<<std::endl;
    }
};

int main() {
    // your code here: declare Device object, assign id, and print it
    Device d(101);
    return 0;
}
Loading...

Input

Expected Output

Device ID: 101