Code Int Secret Int X Int J 2 X 10 J X 2 Else J X 3 Return J 1 Int Another Int Int B Int J Q37020169

CODE
int secret(int x){int i, j;i = 2*x;if(i > 10)j = x/2;elsej = x/3;return j-1;}
int another(int a, int b){int i, j;j = 0;for(i = a; i <=b; i++)j = j+1;return j;}
int main (){cout << another(secret(5), 3) << endl;return 0;}The output of the above code is:__________________________Will the following code compile (circle your answer and theline(s) that may cause problems, if any)? Yes Novoid print_odd(int a){if (a%2 == 0)return;cout << a << ” is odd” << endl;}int main(){print_odd(35);int z = print_odd(21);return 0;}
(6) //CODEbool test(int a, int& b){bool res = false;if(a > b){cout << a << ” is larger than ” << b<< endl;b

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.