Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- int main()
- {
- int begin{ 1 };
- int end{ 1000 };
- int sum{ 0 };
- for (; begin <= end; sum += begin++);
- std::cout << "Average is " << (sum / (float)end) << '\n';
- }
Advertisement
Add Comment
Please, Sign In to add comment