Pergunta de entrevista da empresa Qualcomm

white board: write a function that determines if a given variable is a power of 2 or not

Respostas da entrevista

Sigiloso

28 de nov. de 2019

int check_pwr_of_2(int num) { if((num & (num-1)) == 0) { return 1; } return 0; }

Sigiloso

28 de nov. de 2019

int check_pwr_of_2(int num) { if((num & (num-1)) == 0) { return 1; } return 0; }