Question: X Full S. Debug a function called SumBetween() wnich takes two integer inputs. low and high. This function should calculate the sum of all integers
X Full S. Debug a function called SumBetween() wnich takes two integer inputs. low and high. This function should calculate the sum of all integers between tow and high Inclusive Example: SumBetween(1, 10) should return 55. SumBetween should throw std::invalid argument in low and high are out of order SumBetween should throw std: toverflow_error if the sum exceed the maximum/minimum value of int INT32 MAX is the maximum value of a 32-bit integer INT32_MIN is the minimum value of a 32-bia integet The function prototype is int SumBetween(int low, int high) Only use int Dont use a bioger type it can work, but is not in the spirit of the problemi code.cpp O New 1 - int SumBetween(int low, int high) { 2 int value = 0; 3 for Cint n low; n
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
