C++ | Simple Solution
\n# Code\n\nclass Solution {\npublic:\n    vector<int> evenOddBit(int n) {\n        \n        int index = 0;\n        int even = 0 , odd = 0;\n\n        while(n
\n# Code\n```\nclass Solution {\npublic:\n    vector<int> evenOddBit(int n) {\n        \n        int index = 0;\n        int even = 0 , odd = 0;\n\n        while(n){\n            if(n % 2){\n                if(index % 2) odd++;\n                else even++;\n            }\n            index++;\n            n /= 2;\n        }\n        \n        return {even,odd};\n    }\n};\n```
['Math', 'C++']