Professional Documents
Culture Documents
Quiz 2
Quiz 2
Question 1
What
If
Informal Conversion
Algorithm
Say
divisible by
Its 512
(1,2,4,8,16,32,64,128,256,512,1024,2048,...)
Write down 1
Subtract 512 from 701 = 189
Go through the lower powers of 2 one by
one
If the power of 2 is less than the number
Example
701
512 = 189
256
> 189
10
189
128 = 61
101
64
> 61
1010
61
32 = 29
10101
29
16 = 13
101011
13
8=5
1010111
4=1
10101111
>1
101011110
1010111101
Question 2
What
Question 3
What
printf(true);
else
printf(false);
true
Question 4
dividend: );
dividend: );
dividend % divisor);
Question 5