#include <iostream>
using namespace std;
int main()
{
cout << "Enter a number: ";
int target;
cin >> target;
int num = 0;
int sum;
while ((sum != target) && (num <= target))
{
num++;
sum = (num + (num + 1));
if (num == target)
{
cout << "No consecutive sums found.";
return 0;
}
}
cout << "The two consecutive numbers adding up to " << target << " are: \n" << num << "\n" << (num + 1);
return 0;
}
----------------------------
Use this c++ code.
P.S. that's impossible because the sum of two consecutive integers (which means an odd and an even) has to be odd.
There are no two consecutive whole numbers that sum to 142.With two consecutive whole numbers, one is even and the other odd, and their sum will be odd, but 142 is even.Two consecutive even numbers that sum to 142 are 70 and 72.
No, the sum of two consecutive numbers is always an odd number, and is not divisible by two.
There are two consecutive even numbers. The numbers are 62 and 64.
If you mean two consecutive odd numbers then they are 117 and 119
There are no four consecutive whole numbers that add up to 35. The sum of two consecutive [whole] numbers is an even number plus an odd number which is an odd number. The sum of two consecutive numbers and the two next consecutive numbers is the sum of two odd numbers which is even, but 35 is odd, so no four consecutive whole numbers cannot add up to 35.
There are two consecutive even integers. The numbers are 118 and 120.
The sum of 2 consecutive numbers cannot be 118, because you cannot get an even number when you add an even and an odd number.
There are no two consecutive whole numbers that sum to 142.With two consecutive whole numbers, one is even and the other odd, and their sum will be odd, but 142 is even.Two consecutive even numbers that sum to 142 are 70 and 72.
No two consecutive integers have a sum of 2012.
No, the sum of two consecutive numbers is always an odd number, and is not divisible by two.
There are two consecutive even numbers. The numbers are 62 and 64.
The numbers are 54 and 56.
If you mean two consecutive odd numbers then they are 117 and 119
There are no four consecutive whole numbers that add up to 35. The sum of two consecutive [whole] numbers is an even number plus an odd number which is an odd number. The sum of two consecutive numbers and the two next consecutive numbers is the sum of two odd numbers which is even, but 35 is odd, so no four consecutive whole numbers cannot add up to 35.
There are no two consecutive numbers that equal 70 because the sum of any two consecutive numbers is an odd number.
No. The sum of four consecutive integers is two odd numbers plus two even numbers which is an even number. 2001 is an odd number, therefore it cannot be the sum of four consecutive numbers.
The sum of the numbers is 26. The numbers are 12 and 14.