Pergunta de entrevista da empresa Bitwise

How to find that a given number is even or odd without using (if, else, any loop, conditional operator ,switch). You can use only a "%" sign.

Respostas da entrevista

Sigiloso

5 de nov. de 2017

Use tertiary statement (n%2==0)?even:odd

1

Sigiloso

5 de nov. de 2017

Use tertiary statement (n%2==0)?even:odd

Sigiloso

5 de nov. de 2017

Use tertiary statement (n%2==0)?even:odd

Sigiloso

9 de mar. de 2015

main() { char ch[2][5]={"even","odd"}; cin>>num; cout<

14