mardi 1 juin 2021

if(a%b) //what it means?

// take a=4 and b=2;

if(a%b)
  cout<<"true";
else
  cout<<"false";

The programs output false. I am a bit confused as the if condition passes only true values and if(a%b) means a%b==0; then why is it failing to pass the if statement?

Aucun commentaire:

Enregistrer un commentaire