The sum of two positive even integers is also a positive even integer.
What, if anything, is wrong with the following attempt at proving this theorem?
Proof.Start by choosing the smallest two positive even integers, 2 and 2. 2 + 2 = 4, which is also even. Then try 2 + 4 = 6, which is also even. Then 2 + 10, 2 + 12, etc., all of which add up to even totals. Then try adding 4 + 4 = 8, 4 + 6 = 10, and so on. All the resulting sums, for any two pairs of positive even integers, add up to an even integer. Therefore, the sum of two positive even integers is also a positive even integer.What, if anything, is wrong with the following sequence of proof steps?
If and then is equal to:
If the following expression was evaluated for each integer, i between 10 and 150 inclusive how many times would it return true?
i % 17 == 0
(Hint: do not think about how you would program this. This is a logical question pertaining to the % and == operators. Think about how the operators work. Under which circumstances would this expression evaluate to true?)
What left operand value and right operand value respectively does the multiplication operator operate on in the following expression? You can assume i has the initial value of 5.
i-- * i--
Hint: try it out in IntelliJ and work backwards to deduce what must have happened.