int main() int n=5; if(n & 1) cout<<"odd"; else cout<<"even";
how we are getting even or out using "&" operator it should have been like this
if(n%2!=0) to check the even or odd. can anyone explain what is that code doing.
Aucun commentaire:
Enregistrer un commentaire