Pregunta de entrevista de 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.

Respuestas de entrevistas

Anónimo

5 nov 2017

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

1

Anónimo

5 nov 2017

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

Anónimo

5 nov 2017

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

Anónimo

9 mar 2015

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

14