Created
September 1, 2017 17:13
-
-
Save jesuscmadrigal/ae8e994c569cb2ab2c9104dec8b07acd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main () | |
{ int sum,min,max,n; | |
sum=0; | |
cout << "We´re going to sum up numbers between numbers!!" << endl; | |
cout << "Now pick the first integer that you want to initialized: " << endl; | |
cin >> min; | |
n=min; | |
cout << "Then the second integer please: " << endl; | |
cin >> max; | |
while (n <= max) | |
{ | |
sum=sum+n; | |
n=n+1; | |
} | |
cout << "the sum from " << min << " to " << max << " is: " << sum << endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment