| 5 | #include <iostream> |
| 6 | using namespace std; |
| 7 | int main1() { |
| 8 | int m, n, sum = 0; |
| 9 | cout << "Enter the 1st number: "; |
| 10 | cin >> n; |
| 11 | cout << "Enter the 2nd number: "; |
| 12 | cin >> m; |
| 13 | if (n < m) { |
| 14 | for (int x = n; x <= m; x++) { |
| 15 | sum += x; |
| 16 | } |
| 17 | cout << "The sum of the integers between the two numbers is " << sum << ";" << endl; |
| 18 | } |
| 19 | else if (m < n) |
| 20 | cout << "Invalid numbers! Please try again." << endl; |
| 21 | else if (m == n) { |
| 22 | sum = n; |
| 23 | cout << "The sum is " << sum << endl; |
| 24 | } |
| 25 | system("pause"); |
| 26 | return 0; |
| 27 | } |
nothing calls this directly
no outgoing calls
no test coverage detected