0
fill in the blanks to find out whether the value of "a" is an odd number or even number
int a; cin>>a; if(a_2==0) cout<<"the number is even"; else cout<<"the number is odd";
4 Respostas
+ 3
The answer is '%'; the modulus operator. The modulo returns the remained of a division e.g.
10 % 3 = 1
7 % 5 = 2
30 % 9 = 3
+ 1
%
0
%
0
int a;
cin>>a;
if(a%2==0)
cout<<"the number is even";
else
cout<<"the number is odd";