fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void function1(int &, int &);
  5. int function2(int &);
  6. int function3(int , int);
  7. void function4(int, int, int);
  8.  
  9. int main()
  10. {
  11. int x = 9, y = 7, z = 5;
  12.  
  13. for(int i = 0; i<= 5; i++)
  14. function1(x, y);;
  15.  
  16. z = function2 ( y );
  17.  
  18. if((z>=10 && x<7) || y!= 5)
  19. {
  20. y = function3(x,9);
  21. x = function3(y,9);
  22. }
  23. else
  24. z = function3(z,x);
  25.  
  26. function4(x, y, z);
  27.  
  28. }
  29. void function1(int &a, int &b)
  30. {
  31. a++;
  32. b--;
  33. if(a == b)
  34. a = 2*b;
  35. else
  36. b = a%2;
  37. }
  38. int function2( int & a )
  39. {
  40. a+=2;
  41. return 10;
  42.  
  43. }
  44.  
  45. int function3(int a, int b)
  46. {
  47. return a*2+b/2;
  48. }
  49.  
  50. void function4(int a, int b, int c)
  51. {
  52. cout << "The Result is: " << (a+b)/c << endl;
  53. }
Success #stdin #stdout 0.02s 2724KB
stdin
Standard input is empty
stdout
The Result is: 10