answersLogoWhite

0

15

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

When is the sum of a positive integer and a negative integer positvie?

The sum of a positive integer and a negative integer is positive when the positive integer is greater. For example: 9 + (-5) = 4 In this case, the positive integer 9 is greater than the negative integer 5. Therefore, the sum is positive.


5 What is the sum of all integer numbers from 1 to 200?

200*201/2=20100


What integer divided by the sum of negative 5 and negative 1 equals positive 3?

-18


When is the sum of a positive and negative integer positive?

When the positive integer is farther from 0 than the negative integer, example -4+5=1 why? the -4 is 4 places to the left of the 0 and the 5 is 5 places to the right.


What is the sum of all the odd factors of 70?

The odd positive integer factors of 70 are: 1 5 7 35 The sum of these factors is 1 + 5 + 7 + 35 = 48


What is the sum of smallest and largest 5 digit whole number?

The smallest 5 digit integer is -99999. The largest 5 digit integer is 99999. The sum is therefore 0.


Is the sum of a negative integer and a positive integer is always negative?

No, -3 + 8 = 5.


One integer is four times another The sum of the integers is 5 What is the value of the lesser integer?

Let's denote the unknown integer as "x". So now we have two integers, "x" and "4x" because one integer is 4 times the other. So the sum of x+4x= 5x 5x = 5 So x=1


What happens if you add an integer and its opposite?

When you add an integer and its opposite, the result is always zero. This is because the opposite of an integer is the same number with the opposite sign, effectively canceling it out. For example, if you take 5 and its opposite, -5, their sum is 5 + (-5) = 0. Thus, the addition of any integer and its opposite yields a sum of zero.


Sum of a positive and a negative integer is positive?

Not necessarily. It depends on which number has a greater absolute value. 5 + (-4) = 1 5 + (-9) = -4


How do you know when the sum of a positive integer will be negative?

The sum of two positive numbers is positive. The sum of two negative numbers is negative. The sum of a positive and negative number will depend on which number has a greater absolute value. 5 + (-4) = 1 5 + (-9) = -4


What is the C plus plus program to print the sum of all squares from 1 to n?

#include<iostream> #include<sstream> using namespace std; unsigned sum_of_squares (const unsigned max) { if (max==0) return 0; if (max==1) return 1; return sum_of_squares (max-1) + (max*max); } int main () { unsigned num = 0; while (1) { cout << "Enter a positive integer (0 to exit): "; string s; cin >> s; if (s[0]=='0') break; stringstream ss; ss << s; if (ss >> num) { cout << "The sum of all squares from 1 to " << num << " is: " << sum_of_squares (num) << endl; continue; } cerr << "Invalid input: " << s << endl; } cout << "Quitting..." << endl; } Example output: Enter a positive integer (0 to exit): 1 The sum of all squares from 1 to 1 is: 1 Enter a positive integer (0 to exit): 2 The sum of all squares from 1 to 2 is: 5 Enter a positive integer (0 to exit): 3 The sum of all squares from 1 to 3 is: 14 Enter a positive integer (0 to exit): 4 The sum of all squares from 1 to 4 is: 30 Enter a positive integer (0 to exit): 5 The sum of all squares from 1 to 5 is: 55 Enter a positive integer (0 to exit): 6 The sum of all squares from 1 to 6 is: 91 Enter a positive integer (0 to exit): 7 The sum of all squares from 1 to 7 is: 140 Enter a positive integer (0 to exit): 0 Quitting...