Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
34 views1 page

Pseudocodes For Interview - 2

The pseudocode initializes three integers p, q, and r with values 0, 7, and 10 respectively. It evaluates a condition based on bitwise XOR and addition, which leads to updating the values of q and r. The final output of the sum of p, q, and r is 13.

Uploaded by

anushya.himate
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views1 page

Pseudocodes For Interview - 2

The pseudocode initializes three integers p, q, and r with values 0, 7, and 10 respectively. It evaluates a condition based on bitwise XOR and addition, which leads to updating the values of q and r. The final output of the sum of p, q, and r is 13.

Uploaded by

anushya.himate
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Guess the output for the following pseudocode:

Integer p, q, r

Set p = 0, q = 7, r = 10

if ((q ^ r ^ p) < (r + p + q)) then

r = (p + 1) ^ q

q=q+p

end if

print(p + q + r)

A) 13

B) 16

C) 18

D) 15

The correct answer is 13

You might also like