Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int suma(int x, int y, int &z)
- {
- z=0;
- for(int i=x; i<=y; i++)
- {
- if(i%2==0)
- z=z+i;
- }
- }
- int main()
- {
- int x=12, y=23, z;
- suma(x,y,z);
- cout<<z;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement