Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- int main()
- {
- std::cout << "wirte two numbers:" << std::endl;
- int start = 0, end = 0;
- std::cin >> start >> end;
- int sum = 0;
- while (start <= end) {
- sum += start;
- ++start;
- }
- std::cout << "Sum of 1 to 10 inclusive is "
- << sum << std::endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement