Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int func(int a, int &b){
- int aux;
- if(a > b){
- aux = a;
- a = b;
- b = aux;
- }
- int cont = 0;
- while(cont < 3){
- a = a * 2;
- cont = cont + 1;
- }
- if(b%3 == 0)
- b = b + 1;
- else
- b = b - 1;
- resp = a + b;
- a = 20;
- return resp;
- }
- int main(){
- int x, y, z;
- x = 8;
- y = 6;
- z = func(x, y);
- cout << "X = " << x << endl;
- cout << "Y = " << y << endl;
- cout << "Z = " << z << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement