How can check for even number results? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
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 Answers
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