[9/8, 3:50 PM] Abhiram: Integer p,q,r 2. Set p = 2 q = 4 r = 10 3. for(each r from 2 to 6) 4. q = (q ^ 2) + r 5. if((r + p) ^ (p ^ q) > (r ^ (p ^ q))) 6. p = 4 + r 7. p = (886) ^ r 8. End if 9. End for 10. Print p+q Note- &: bitwise AND - The bitwise AND operator (&) compares each bit of the first operand to the corresponding bit of the second operand. If both bits are 1, the corresponding result bit is set to 1. Otherwise, the corresponding result bit is set to 0. ^is the bitwise exclusive OR operator that compares each bit of its first operand to the corresponding bit of its second operand. If one bit is 0 and the other bit is 1, the corresponding result bit is set to 1. Otherwise, the corresponding result bit is set to 0. Ops: A. 18 B. 32 C. 36 D. 48 [9/8, 3:50 PM] Abhiram: ans [9/8, 3:50 PM] Abhiram: fast [9/8, 3:51 PM] Abhiram: What will be the output of the following pseudo code? 1. Integer p,٩,٢ 2. Set p, 92, 15 3. r=r+q 4. p=(r+p)+q 5. г-88г 6. pag+p 7. Print piger Note- & bitwise AND-The bitwise AND operator (&) compares each bit of the first operand to the corresponding bit of the second operand. If both bits are 1, the corresponding result bit is set to 1. Otherwise, the corresponding result bit is set to 0. Ops: A. 26 B. 19 C013 D. 17 [9/8, 3:52 PM] Abhiram: 1. Integer funn(Integer a, Integer b, Integer c) 2. for(each c from 3 to 7) 3. b=(b+9)&b 4. 5. if((78c&a)<(c&a&7)) Continue 6. Else b=(5^1)^a 7. 8. End if 9. End for 10. return a+b Note- Continue: When a continue statement is encountered inside a loop, control jumps to the beginning of the loop for next iteration, skipping the execution of statements inside the body of the loop for the current iteration. & bitwise AND - The bitwise AND operator (8) compares each bit of the first operand to the corresponding bit of the second operand. If both bits are 1, the corresponding result bit is set to 1. Otherwise, the corresponding result bit is set to 0. is the bitwise exclusive OR operator that compares each bit of its first operand to the corresponding bit of its second operand. If one bit is 0 and the other bit is 1, the corresponding result bit is set to 1. Otherwise, the corresponding result bit is set to 0. Ops: A 20 C017 038
lass Solution { public int funn(int a, int b, int c) { int sum = 0; for (int i = 0; i < a + b + c; i++) { sum += i; } return sum; } } A: You can use a simple for loop to do this. The trick is to use the modulus operator % to