Answers for "c++ check if number is even or odd"

C++
0

c++ check if number is even or odd

#include <iostream>
using namespace std;
int main() {
   int num = 7;
   if((num & 1) == 0)
   cout<<num<<" is even";
   else
   cout<<num<<" is odd";
   return 0;
}
Posted by: Guest on August-03-2021

Code answers related to "c++ check if number is even or odd"

Browse Popular Code Answers by Language