Advertisement
Dizzy3113

Untitled

Nov 17th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int suma(int x, int y, int &z)
  6. {
  7. z=0;
  8. for(int i=x; i<=y; i++)
  9. {
  10. if(i%2==0)
  11. z=z+i;
  12. }
  13. }
  14. int main()
  15. {
  16. int x=12, y=23, z;
  17. suma(x,y,z);
  18. cout<<z;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement