Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int i, x = 0, m = 5;
- int main()
- {
- for (i = 1; i <= m; i++)
- {
- x += i;
- if (i < m)
- cout << i << " + ";
- else
- cout << i << " = " << x << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement