Motorola Solutions Interview Question

polymorphism in C++, 2 easy task to write: count a parity bit, inheritance

Interview Answers

Anonymous

Jan 9, 2019

parity bit: int n = 12; int a; while (n!=0){ n=n & (n-1) a=n; } sysout (a); which is 12 & 11 -> 8

Anonymous

Jan 9, 2019

parity bit: int n = 12; int a; while (n!=0){ n=n & (n-1) a=n; } sysout (a); which is 12 & 11 -> 8 (1000)