0

How can check for even number results?

defining a functon that will print even number results only

24th Jan 2017, 4:33 PM
Bob Stauffer
Bob Stauffer - avatar
3 Réponses
0
% operator can be used to find the reminder So by condition " number %2==0" the function can be defined
24th Jan 2017, 4:49 PM
Athul P Ramachandran
Athul P Ramachandran - avatar
0
thanks
24th Jan 2017, 4:50 PM
Bob Stauffer
Bob Stauffer - avatar
0
Recent answer is right. Explanation: "%" operator is the Modulo operator, that give the remainder of a devision. If the remainder is 0, the number is even.
24th Jan 2017, 8:13 PM
sebimuc