Shrek and Donkey
The integers are -34 and -33.
If you write down all of the integers between the two numbers, your sum is equivalent to 5,659.
-- Ignore the signs for a moment. -- Find the difference of the two integers. -- Give it the sign of whichever integer is the bigger number.
They are 2n+2
jgfujtf
Shrek and Donkey
Write a program to find the number and sum of all integers from 100 to 300 that are divisible by 11
Algorithm: sum_evenInput: an integer, n, such that n>0Output: the sum of all even integers within the open range (1:n)sum := 0val := 2while (val < n) do{sum := sum + valval := val + 2}return sumNote that you explicitly specified between 1 and n, which literally means both 1 and n should be excluded from the sum. 1 would be excluded anyway since it is not an even number, however if we wish to include n, then use the following algorithm instead:Algorithm: sum_evenInput: an integer, n, such that n>0Output: the sum of all even integers within the half-open range (1:n]sum := 0val := 2while (val
-- write the difference between the integers without regard to their signs -- give the difference the same sign as the larger of the two integers
The sum of the squares of two consecutive positive even integers is 340. Find the integers.
The integers are -34 and -33.
The sum of any two consecutive integers must be an odd number. So this question is incorrect.
Find 2 consecutive ODD integers whose sum is -88 ANSWER: -45, -43
If you write down all of the integers between the two numbers, your sum is equivalent to 5,659.
The sum is infinitely large.
-- Ignore the signs for a moment. -- Find the difference of the two integers. -- Give it the sign of whichever integer is the bigger number.