Free help with homework

Why join Brainly?

  • ask questions about your assignment
  • get answers with explanations
  • find similar questions


You can use the modulo (%) operator. If it's divisible by 2, that means it's even.

int x;
cout<<"enter a number";
if(x%2==0){cout<<"it is even"<<endl;}
else cout<<"it is odd";

***Note that I used C++
0 0 0
The Brain
  • The Brain
  • Helper
Not sure about the answer?
Learn more with Brainly!
Having trouble with your homework?
Get free help!
  • 80% of questions are answered in under 10 minutes
  • Answers come with explanations, so that you can learn
  • Answer quality is ensured by our experts