My question is: how can I check if each input number is all divisible by 2? My input for example is 246708, and I want to check if all of these numbers are divisible by 2.
I am thinking of putting the numbers first in a list and get each number one by one then do the operations. But I don't know how to do that in the mit app or is it best way of doing it? thanks for the help
So 246708 is not a single big even number that ends in 8 and is therefore even, but instead is a set of 6 single digit numbers that have to all be even?
If you need to check each digit, you could check using the text CONTAINS block.
Say the input text is in txbInput.Text so you could test for
if it contains '1' or
if it contains '3' or
if it contains '5' or
if it contains '7' or
if it contains '9'
then not all digits are even.
That's what you asked for, but it might not be what you want.
Is that what you want?
@SHUBHAMR69 you procedure goes through the loop and displays result for last item in loop. Check for example number 22221 if you actually want to use such a procedure you have to add true or false to a temp list and check if false exists in list
Actually it sets the result to false if any of the digit is not even.
There is no such block in it to set the result to true, so for any odd digit, the result will be set to false, but for any even digit, nothing will happen.
If there is no odd digit, the default value, i.e., true, will be returned.