Select the correct answer Predict the output of the following pseudo-code if x= 1 and y=2: Integer solve(int x, int y) if(x > 1) solve(x – 1, y + 3) end if print y End function solve() radio_button_unchecked 6 radio_button_unchecked 2 radio_button_unchecked 3 radio_button_unchecked 4
Question
Select the correct answer Predict the output of the following pseudo-code if x= 1 and y=2:
Integer solve(int x, int y) if(x > 1) solve(x – 1, y + 3) end if print y End function solve()
radio_button_unchecked 6
radio_button_unchecked 2
radio_button_unchecked 3
radio_button_unchecked 4
Solution
2
Similar Questions
Select the correct answer What will be the output of the following pseudocode? Initialize Integer x, y, z Set y = 1, x = 2 z = x & y Print z radio_button_unchecked 0 radio_button_unchecked 2 radio_button_unchecked 4 radio_button_unchecked 3
Select the correct answer What will be the output of the following pseudocode for a = 3, b = 2 ? Integer funn ( integer a, integer b ) if ( b ^ a > (( a + 1) ^ ( b + 1 ))) a= a & b else b = a + 1 end if return a+ b end function funn ( ) radio_button_unchecked 4 radio_button_unchecked 5 radio_button_unchecked 47 radio_button_unchecked 56
Select the correct answer What will be the output of the following pseudocode? Integer value, n Set value = 32, n = 1 while(value greater than equal to n) value = value >> 1 end loop Print value radio_button_unchecked 16 radio_button_unchecked 32 radio_button_unchecked 64 radio_button_unchecked 0
What will be the output of the following pseudo code ? Integer a,b,c Set a=7, b=4, c=8 if((b-c+a)<(a+b)) if((a^c^7)<(4+b+a)) b=c+c for (each c from 2 to 4 ) a=(b+c)&b End for Else a=(a&a)+b End if a=(a^12)+a End if Print a+b+c radio_button_unchecked 35 radio_button_unchecked 64 radio_button_unchecked 44 radio_button_unchecked 56
If a + b + 1 = 0, then the value of (a3 + b3 + 1 – 3ab) is:radio_button_unchecked3radio_button_unchecked0radio_button_unchecked1radio_button_unchecked-1
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.