Question: 6 last string digit is even divides by 3 8 Version 1 is the last string digit even ( 0 , 2 , 4 ,

6
last string digit is even
divides by 3
8
Version 1
is the last string digit even (0,2,4,6,8)
divide by 2(convert to number, divide, return to string)
is the new value even
divide by 2(convert to number, divide, return to string)
is the new value even
version 2
look at last bit, is it 0
bit shift left
is the last bit 0?
bit shift left
is the last bit 0?
version 3
are the last 3 bits 000-- this masks the last 3 bits ( not( bit & 7))
9
version 1
is if divisible by 3(see above)
divide by 3
is the new result divisible by 3
version 2
using the algorithm for divide by 3, test to see if the final single digit string is 0 or 9

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!