C++ Constructor Initialization

#include<iostream>
using namespace std;
class anik
{
public :
    const int adf;
    const int xmf;
    int z;

    anik(int x, int y, int a)
    : adf (x), xmf (y)
    {
        cout << "Admission Fee : " << x << endl;
        cout << "Exam Fee : " << y << endl;
        z = a;
        cout << "ID : " << a << endl;
    }
};
int main()
{
    anik a(15000, 500, 101);

    return 0;
}

Comments