fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3. void sum(int x,int y,int& sum,int& product){
  4. sum=x+y;
  5. product=x*y;
  6. }
  7.  
  8. int main() {
  9.  
  10. // your code goes here
  11. int a,b,s=0,p=0;
  12. cin>>a>>b;
  13. sum(a,b,p,s);
  14. cout<<a<<" "<<b<<" "<<s<<" "<<p;
  15. return 0;
  16. }
Success #stdin #stdout 0s 5320KB
stdin
2 3
stdout
2 3 6 5