0% found this document useful (0 votes)
36 views189 pages

Pseudo Code

Uploaded by

satish k
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views189 pages

Pseudo Code

Uploaded by

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

Pseudocode

What will be the output of the following pseudocode?

A)25 B)28 C)38 D)18

Integer p, q, r
Set p=9, q=5, r=5
p=(r&q)&q
r=(r&r)&r
r=(q+5)+q
Print p+q+r
What will be the output of the following pseudocode?

A)25 B)28 C)38 D)18

Integer p, q, r
Set p=9, q=5, r=5
p=(r&q)&q
r=(r&r)&r
r=(q+5)+q
Print p+q+r

Answer: 25
What will be the output of the following pseudocode?

A)14 B)24 C)13 D)9

Integer p,q,r
Set p=1, q=2, r=10
If((1+p)<q || (r+3)<3)
q=9+q
if((q+p+r)<(r+6))
p=(p+p) +q
End if
r=q+p
End if
Print p+q+r
What will be the output of the following pseudocode?

A)14 B)24 C)13 D)9

Integer p,q,r
Set p=1, q=2, r=10
If((1+p)<q || (r+3)<3)
q=9+q
if((q+p+r)<(r+6))
p=(p+p) +q
End if
r=q+p
End if
Print p+q+r

Answer: 13
What will be the output of the following pseudocode?

A)13 B)10 C)22 D)12

Integer pp,qq,rr
Set pp=3, qq=8, rr=6
for (each rr from 5 to 8)
If((qq+pp)>(pp+qq))
continue
End if
qq=1+rr
End for
Print pp+qq
What will be the output of the following pseudocode?

A)13 B)10 C)22 D)12

Integer pp,qq,rr
Set pp=3, qq=8, rr=6
for (each rr from 5 to 8)
If((qq+pp)>(pp+qq))
continue
End if
qq=1+rr
End for
Print pp+qq

Answer: 12
What will be the output of the following pseudocode for a=10,b=20?

A)63 B)84 C)87 D)95

Integer funn(Integer a,Integer b)


if(4<a && (1^a)>(a+b))
b=(b+2)+a
b=a+1
return funn(a,b)+funn(a,b+a)
End if
a=(b+3)+b
return a+b
What will be the output of the following pseudocode for a=10,b=20?

A)63 B)84 C)87 D)95


10 = 1010
Integer funn(Integer a,Integer b) 1 = 0001
if(4<a && (1^a)>(a+b))
b=(b+2)+a 10^1 = 1011
b=a+1
return funn(a,b)+funn(a,b+a)
End if
a=(b+3)+b
return a+b

Answer: 63
What will be the output of the following pseudo code?

A)27 B)12 C)16 D)70

Integer pp,qq,rr
Set pp=9, qq=4, rr=6
pp-4+qq
pp=(4^6)+qq
Print pp+qq+rr
What will be the output of the following pseudo code?

A)27 B)12 C)16 D)70

Integer pp,qq,rr
Set pp=9, qq=4, rr=6
pp-4+qq
pp=(4^6)+qq
Print pp+qq+rr

Answer: 16
What will be the output of the following pseudocode?

A)19 B)24 C)16 D)28

Integer p,q,r
Set p=2, q=2, r=10
for(each r from 2 to 3)
q=(r+9)+p
q=q+r
End for
Print p+q
What will be the output of the following pseudocode?

A)19 B)24 C)16 D)28

Integer p,q,r
Set p=2, q=2, r=10
for(each r from 2 to 3)
q=(r+9)+p
q=q+r
End for
Print p+q

Answer: 19

Note: q = (r+9)+p+r
What will be the output of the following pseudo code for a=5, b=2, c=7?

A)28 B)31 C)37 D)41

Integer funn(Integer a, Integer b, Integer c)


a=(b+b)+b
b=1+b
c=(9+5)+b
a=5+a
return a+b+c
What will be the output of the following pseudo code for a=5, b=2, c=7?

A)28 B)31 C)37 D)41

Integer funn(Integer a, Integer b, Integer c)


a=(b+b)+b
b=1+b
c=(9+5)+b
a=5+a
return a+b+c

Answer: 31
What will be the output of the following pseudocode for a=5, b=2?

A)16 B)1 C)4 D)0

Integer funn(Integer a, Integer b)


if((a&b)<(b+a) && 1>b)
a=b+2
b=(b+2)+b
a=(a+1)+b
return funn(a,b)-a+funn(b,b)
End if
b=3+b+a
return a-1
What will be the output of the following pseudocode for a=5, b=2?

A)16 B)1 C)4 D)0


A = 5 = 0101
Integer funn(Integer a, Integer b) B = 2 = 0010
if((a&b)<(b+a) && 1>b) 0000
a=b+2
b=(b+2)+b
a=(a+1)+b
return funn(a,b)-a+funn(b,b)
End if
b=3+b+a
return a-1

Answer: 4
What will be the output of the following pseudocode?

A)12 B)21 C)14 D)30

Integer a,b,c
Set a=5, b=2, c=4
for(each c from 3 to 6)
a=(b+c)+b
End for
for(each c from 3 to 6)
a=c+c
End for
Print a+b
What will be the output of the following pseudocode?

A)12 B)21 C)14 D)30

Integer a,b,c
Set a=5, b=2, c=4
for(each c from 3 to 6)
a=(b+c)+b
End for
for(each c from 3 to 6)
a=c+c
End for
Print a+b

Answer: 14
What will be the output of the following pseudocode a=5, b=2?

A)12 B)38 C)23 D)48

Integer funn(Integer a, Integer b)


if(1>b && 4>b)
a=(b+3)+a
a=2+a+a
b=1+1+b
return funn(a+1,b+2)+2+funn(a-1,a+1)
End if
a=(a+2)+a
return a
What will be the output of the following pseudocode a=5, b=2?

A)12 B)38 C)23 D)48

Integer funn(Integer a, Integer b)


if(1>b && 4>b)
a=(b+3)+a
a=2+a+a
b=1+1+b
return funn(a+1,b+2)+2+funn(a-1,a+1)
End if
a=(a+2)+a
return a

Answer: 12
What will be the output of the following pseudocode a=5, b=2?

A)16 B)15 C)7 D)35

Integer funn(Integer a, Integer b)


if((4-a)>(a-b) && a<4)
a=3+2+a
a=3+1+a
a=1+3+b
return a+funn(a,b)+funn(a,a)
End if
return a+b
What will be the output of the following pseudocode a=5, b=2?

A)16 B)15 C)7 D)35

Integer funn(Integer a, Integer b)


if((4-a)>(a-b) && a<4)
a=3+2+a
a=3+1+a
a=1+3+b
return a+funn(a,b)+funn(a,a)
End if
return a+b

Answer: 7
What will be the output of the following pseudo code for a=9, b=8?

A)-22 B)-29 C)-26 D)-34

Integer funn(Integer a, Integer b)


if((a-5)>(b^a) && (b-a)<(a^b))
a=a+2
b=b+3
a=3+1+b
return funn (b+1,b)+funn (a,a)
End if
a=(b+1)+a
return b-a
What will be the output of the following pseudo code
for a=9, b=8?
Explanation:
First Iteration:
A)-22 B)-29 C)-26 D)-34
Initially, we have
a=9 and b=8
Integer funn(Integer a, Integer b)
a^b or b^a = 1
if((a-5)>(b^a) && (b-a)<(a^b))
a = 11
a=a+2
b = 11
b=b+3
a = 15
a=3+1+b
Second:fun(12,11)
return funn (b+1,b)+funn (a,a)
a = 12, b = 11
End if
a^b or b^a = 7  if condition
a=(b+1)+a
fails
return b-a
a = 24
return b-a  -13
Answer: -29
What will be the output of the following pseudo code?

A) 10 B) 20 C) 30 D) 40

Integer a,b,c
Set a = 3, b = 5, c = 10
if((c+a)<(b-c))
c = (c + 8) + b
End if
if(4 > b && (c &b) < b)
c = (a + 7) + b
Else
c = a &c
End if
Print a+b+c
What will be the output of the following pseudo code?

A) 10 B) 20 C) 30 D) 40
Explanation:
Integer a,b,c
First if condition false
Set a = 3, b = 5, c = 10
if((c+a)<(b-c))
Second if condition false
c = (c + 8) + b
End if
else
if(4 > b && (c &b) < b)
c = 3&10 = 2
c = (a + 7) + b
Else
3+5+2 = 10
c = a &c
End if
Print a+b+c
What will be the output of the following pseudo code a=0 b=0?

A)15 B)35 C)16 D)-34

Integer funn(Integer a, Integer b)


if((4-a)>(a-b) && a<4)
a=3+2+a
a=3+1+a
a=1+3+b
return a+funn (a,b)+funn (a,a)
End if
return a+b
What will be the output of the following pseudo code a=0 b=0?

A)15 B)35 C)16 D)-34


Explanation:
Integer funn(Integer a, Integer b)
if((4-a)>(a-b) && a<4) return
a=3+2+a 4+funn(4,0)+fun(4,4)
a=3+1+a
a=1+3+b funn(4,0)  return 4
return a+funn (a,b)+funn (a,a) funn(4,4)  return 8
End if
return a+b 4+4+8 = 16

Answer: 16
What will be the output of the following pseudo code?

A) 67 B) 53 C) 45 D)54

Integer p,q,r
Set p=2, q=8, r=5
if(p<r)
p=(q+7)+r
Else
p=q+q
End if
Q=(12+11)+r
if((r^7^7)>(q^8))
p=(7&2)+p
End if
Print p+q+r
What will be the output of the following pseudo code?

A) 67 B) 53 C) 45 D)54
Explanation:
p = 2, q=8, r=5
Integer p,q,r
Set p=2, q=8, r=5
if(true)
if(p<r)
p = 20
p=(q+7)+r
Else
q = 28
p=q+q
r^7^7 = 5 and q^8 = 20
End if
Q=(12+11)+r
if(false)
if((r^7^7)>(q^8))
p=(7&2)+p
p+q+r = (23+28+5)53
End if
Print p+q+r
What will be the output of the following pseudocode?

A) 10 B) 12 C) 14 D) 8

Integer p,q,r
Set p = 4, q=2, r=8
if((7+r) <q || (p+r)<q)
if((2+3)<q)
r=(7+11)+p
End if
Else
r=(6+4)&p
if((p+4)<(9+p))
q=(p+6)&r
End if
r=(q+4)&p
What will be the output of the following pseudocode?

A) 10 B) 12 C) 14 D) 8

Integer p,q,r
Set p = 4, q=2, r=8
if((7+r) <q || (p+r)<q)
if((2+3)<q)
r=(7+11)+p
End if
Else
r=(6+4)&p
if((p+4)<(9+p))
q=(p+6)&r
End if
r=(q+4)&p
What will be the output of the following pseudocode?

A)18 B)11 C)25 D)16

Integer a,b,c
Set a=0, b=4, c=4
for(each c from 4 to 7)
a=(a+b)+a
a=(b+b)+b
End for
Print a+b
What will be the output of the following pseudocode?

A)18 B)11 C)25 D)16

Integer a,b,c
Set a=0, b=4, c=4
for(each c from 4 to 7)
a=(a+b)+a
a=(b+b)+b
End for
Print a+b

Answer: 16
What will be the output of the following pseudocode?

A)26 B)217 C)112 D)145

Integer p,q,r
Set p = 7 , q = 2, r = 9
if ((p&3)<r)
p=q+q
Else
if((r ^ 4) < 4)
p =(p&12)+q
q = (2 + 4) + p
Else
p = (r + 2) + r
End if
q =(2 ^9 )+q
What will be the output of the following pseudocode?

A)26 B)217 C)112 D)145

Integer p,q,r
Set p = 7 , q = 2, r = 9
if ((p&3)<r)
p=q+q
Else
if((r ^ 4) < 4)
p =(p&12)+q
q = (2 + 4) + p
Else
p = (r + 2) + r
End if
q =(2 ^9 )+q
What will be the output of the following pseudocode?

A)322 B)334 C)323 D)318

Integer a,b,c
Set a=7, b=4, c=4
for(each c from 2 to 6)
a=(10+5)+a
if((a&b)<c)
a=a+a
b=(a+8)^a
End if
End for
Print a+b
What will be the output of the following pseudocode?

A)322 B)334 C)323 D)318

Integer a,b,c
Set a=7, b=4, c=4
for(each c from 2 to 6)
a=(10+5)+a
if((a&b)<c)
a=a+a
b=(a+8)^a
End if
End for
Print a+b

Answer: 322
What will be the output of the following pseudocode?

A)25 B)8 C)12 D)11

Integer a,b,c
Set a=3, b=5, c=4
C=(5ˆ2)+a
for(each c from 3 to 5)
b=(a+9)&c
a=3&a
b=(cˆb)+c
a=(5+8)&a
End for
Print a+b
What will be the output of the following pseudocode?

A)25 B)8 C)12 D)11

Integer a,b,c
Set a=3, b=5, c=4
C=(5ˆ2)+a
for(each c from 3 to 5)
b=(a+9)&c
a=3&a
b=(cˆb)+c
a=(5+8)&a
End for
Print a+b

Answer: 11
What will be the output of the following pseudocode a=8 b=7?

A)14 B)19 C)24 D)5

Integer funn(Integer a, Integer b)


if((a-4)<(b&5) && (7+b)<(bˆa))
b=a+2
b=3+1+b
b=3+1+a
return funn(a,b)-b+funn(a+b,b)
End if
return b+1
What will be the output of the following pseudocode a=8 b=7?

A)14 B)19 C)24 D)5

Integer funn(Integer a, Integer b)


if((a-4)<(b&5) && (7+b)<(bˆa))
b=a+2
b=3+1+b
b=3+1+a
return funn(a,b)-b+funn(a+b,b)
End if
return b+1

Answer: 14
What will be the output of the following pseudocode?

A) 18 B) 12 C) 17 D)10

Integer a,b,c
Set a=6, b=2, c=9
c=(c+a)+b
for(each c from 2 to 4)
a=(4ˆ10)+b
End for
Print a+b
What will be the output of the following pseudocode?

A) 18 B) 12 C) 17 D)10

Integer a,b,c
Set a=6, b=2, c=9
c=(c+a)+b
for(each c from 2 to 4)
a=(4ˆ10)+b
End for
Print a+b

Answer: 18
What will be the output of the following pseudocode a=6 b=6?

A)39 B)26 C)44 D)50

Integer funn(Integer a, Integer b)


if((b<7 && (a-b)<(b&a))
b=2+2+a
a=1+1+a
b=2+b+b
return b+funn(b,a)-a+2
End if
return a+1
What will be the output of the following pseudocode a=6 b=6?

A)39 B)26 C)44 D)50

Integer funn(Integer a, Integer b)


if((b<7 && (a-b)<(b&a))
b=2+2+a
a=1+1+a
b=2+b+b
return b+funn(b,a)-a+2
End if
return a+1

Answer:39
What will be the output of the following pseudocode?

A)16 B)8 C)11 D)27

Integer a,b,c
Set a=6, b=2, c=9
a=a+b
for(each c from 4 to 6)
a=3+c
End for
Print a+b
What will be the output of the following pseudocode?

A)16 B)8 C)11 D)27

Integer a,b,c
Set a=6, b=2, c=9
a=a+b
for(each c from 4 to 6)
a=3+c
End for
Print a+b

Answer: 11
What will be the output of the following pseudocode?

A)63 B)66 C)78 D)49

Integer a,b,c
Set a=3, b=5, c=4
B=(a+11)+b
If((b+5+a)>(8+b))
b=(a+7)+c
Else
if((c+a)<(7-c))
b=(b+1)+c
c=12+a
Else
a=(9+7)+a
End if
What will be the output of the following pseudocode?

A)63 B)66 C)78 D)49

Integer a,b,c
Set a=3, b=5, c=4
B=(a+11)+b
If((b+5+a)>(8+b))
b=(a+7)+c
Else
if((c+a)<(7-c))
b=(b+1)+c
c=12+a
Else
a=(9+7)+a
End if
What will be the output of the following pseudocode?

A) 37 B) 41 C) 67 D) 32

Integer a,b,c
Set a = 6 , b = 7 , c=6
a = (10 + 1) + b
if(a>c && (b + c) < (8 - b) )
a = (12 + 1)+b
if((b+c+a)<(a+b))
a=(a+c)+b
else
a = (5 + 10) deg * b
End if
Else
b=c+b
What will be the output of the following pseudocode?

A) 37 B) 41 C) 67 D) 32

Integer a,b,c
Set a = 6 , b = 7 , c=6
a = (10 + 1) + b
if(a>c && (b + c) < (8 - b) )
a = (12 + 1)+b
if((b+c+a)<(a+b))
a=(a+c)+b
else
a = (5 + 10) deg * b
Answer: 37
End if
Else
b=c+b
What will be the output of the following pseudocode a=1, b=2, c=3?

A)23 B)6 C)19 D)13

Integer funn(Integer a, Integer b, Integer c)


if((bˆ8)<(5+b))
c=b+b
a=8+a
End if
return a+b+c
What will be the output of the following pseudocode a=1, b=2, c=3?

A)23 B)6 C)19 D)13

Integer funn(Integer a, Integer b, Integer c)


if((bˆ8)<(5+b))
c=b+b
a=8+a
End if
return a+b+c

Answer: 6
What will be the output of the following pseudocode?

A) 33 B) 34 C) 43 D) 31

Integer pp,qq,rr
Set pp = 2, qq=3, rr=9
qq=rr+pp
if((ppˆqqˆrr)<(qq+rr&pp))
pp=2&rr
Else
if(8<rr)
rr+(4ˆ1)+qq
else
rr=(pp+10)&rr
End if
rr=(6+12)+pp
What will be the output of the following pseudocode?

A) 33 B) 34 C) 43 D) 31

Integer pp,qq,rr
Set pp = 2, qq=3, rr=9
qq=rr+pp
if((ppˆqqˆrr)<(qq+rr&pp))
pp=2&rr
Else
if(8<rr)
rr+(4ˆ1)+qq
else
rr=(pp+10)&rr
End if
rr=(6+12)+pp
What will be the output of the following pseudocode a=2 b=0?

A) 35 B) 43 C) 39 D)31

Integer funn(Integer a, Integer b)


if((a-b)>(b&a) && (a^2)<(b+a))
b=1+2+b
a=2+1+b
return funn(b,b)+funn(a+1,b)
End if
return b+1
What will be the output of the following pseudocode a=2 b=0?

A) 35 B) 43 C) 39 D)31

Integer funn(Integer a, Integer b)


if((a-b)>(b&a) && (a^2)<(b+a))
b=1+2+b
a=2+1+b
return funn(b,b)+funn(a+1,b)
End if
return b+1

Answer: 31
What will be the output of the following pseudocode a=8 b=7?

A) 14 B) 15 C) 17 D) 18

Integer funn(Integer a, Integer b)


if((a-4)<(b&5) && (7+b)<(b^a))
b=a+2
b=3+1+b
b=3+1+a
return funn(a;b)-b+funn(a+b,b)
End if
return b+1
What will be the output of the following pseudocode a=8 b=7?

A) 14 B) 15 C) 17 D) 18

Integer funn(Integer a, Integer b)


if((a-4)<(b&5) && (7+b)<(b^a))
b=a+2
b=3+1+b
b=3+1+a
return funn(a;b)-b+funn(a+b,b)
End if
return b+1

Answer: 14
What will be the output of the following pseudocode?

A) 39 B) 67 C) 45 D) 32

Integer p,q,r
Set p = 9, q=5, r=8
for(each r from 5 to 6)
if((p+r) <(r-p) || q<p)
q=p+r
End if
if((r&3)<p)
p=p^r
continue
End if
p=p+p
End for
What will be the output of the following pseudocode?

A) 39 B) 67 C) 45 D) 32

Integer p,q,r
Set p = 9, q=5, r=8
for(each r from 5 to 6)
if((p+r) <(r-p) || q<p)
q=p+r
End if
if((r&3)<p)
p=p^r
continue
End if
p=p+p
End for
What will be the output of the following pseudocode?

A) 56 B) 90 C) 78 D) 62

Integer p,q,r
Set p = 2, q=6, r=7
if(1<r && (q+p)>(p-q))
p=q+q
End if
q=(p+11)+r
If((r-p+q)<(q+r))
p=(r+12)+r
End if
q=p^r
Print p+q+r
What will be the output of the following pseudocode?

A) 56 B) 90 C) 78 D) 62

Integer p,q,r
Set p = 2, q=6, r=7
if(1<r && (q+p)>(p-q))
p=q+q
End if
q=(p+11)+r
If((r-p+q)<(q+r))
p=(r+12)+r
End if
q=p^r
Print p+q+r
What will be the output of the following pseudocode?

A) 40 B) 56 C) 67 D) 30

Integer p,q,r
Set p = 9, q=5, r=8
p=p+r
for(each f from 2 to 3)
if((p-q+r)<(r+p))
if((r^p)<q && (q&3)<p)
p=r^p
End if
End if
End for
Print p+q+r
What will be the output of the following pseudocode?

A) 40 B) 56 C) 67 D) 30

Integer p,q,r
Set p = 9, q=5, r=8
p=p+r
for(each f from 2 to 3)
if((p-q+r)<(r+p))
if((r^p)<q && (q&3)<p)
p=r^p
End if
End if
End for
Print p+q+r
What will be the output of the following pseudocode a=3 b=4?

A) 45 B) 56 C) 46 D) 55

Integer funn(Integer a, Integer b)


if((b-a)>(a-b) && ($&a)>(a-4))
a=b+3
b=2+1+a
b=2+a+b
return funn(a,b)+b
End if
return a+b
What will be the output of the following pseudocode a=3 b=4?

A) 45 B) 56 C) 46 D) 55

Integer funn(Integer a, Integer b)


if((b-a)>(a-b) && ($&a)>(a-4))
a=b+3
b=2+1+a
b=2+a+b
return funn(a,b)+b
End if
return a+b

Answer: 45
What will be the output of the following pseudocode?

A) 12 B) 16 C) 8 D) 9

Integer p,q,r
Set p = 4, q=2, r=8
if((7+r)<q || (p+r)<q)
if((2+3)<q)
r=(7+11)+p
End if
else
r=(6+4)&p
if((p+4)<(9+p))
q=(p+6)&r
End if
r=(q+4)&p
What will be the output of the following pseudocode?

A) 12 B) 16 C) 8 D) 9

Integer p,q,r
Set p = 4, q=2, r=8
if((7+r)<q || (p+r)<q)
if((2+3)<q)
r=(7+11)+p
End if
else
r=(6+4)&p
if((p+4)<(9+p))
q=(p+6)&r
End if
r=(q+4)&p
What will be the output of the following pseudocode for a=1 b=8?

A)-48 B)-43 C)-46 D)-37

Integer funn(Integer a, Integer b)


if((a^b)>(3-a) && (a-2)<(b&6))
b=1+3+b
a=b+1
b=3+a+a
return a-funn(b,b)
End if
b=a+2
return a+b-1
What will be the output of the following pseudocode for a=1 b=8?

A)-48 B)-43 C)-46 D)-37

Integer funn(Integer a, Integer b)


if((a^b)>(3-a) && (a-2)<(b&6))
b=1+3+b
a=b+1
b=3+a+a
return a-funn(b,b)
End if
b=a+2
return a+b-1

Answer: -46
What will be the output of the following pseudocode?

A)31 B)25 C)42 D)34

Integer a,b,c
Set a=3, b=5, c=4
If((1+c+8)<(8+1))
if((1-7)>(b+1))
a=a+b Else
Else c=(4+8)+a
a=(b+3)+c End if
End if a=3+c
a=5+b End if
Else C=(8+7)+c
if((c+9)+(9+3)>(c+a+b))Print a+b+c
What will be the output of the following pseudocode?

A)31 B)25 C)42 D)34

Integer a,b,c
Set a=3, b=5, c=4
If((1+c+8)<(8+1))
if((1-7)>(b+1))
a=a+b Else
Else c=(4+8)+a
a=(b+3)+c End if
End if a=3+c
a=5+b End if
Else C=(8+7)+c
if((c+9)+(9+3)>(c+a+b))Print a+b+c
What will be the output of the following pseudocode a=9 b=0?

A)12 B)8 C)13 D)3

Integer funn(Integer a, Integer b)


if((3^a)>(a+b) && 2>b)
a=2+b+b
a=a+2
a=1+a+a
return funn(a,b+a)-a
End if
return a+b-1
What will be the output of the following pseudocode a=9 b=0?

A)12 B)8 C)13 D)3

Integer funn(Integer a, Integer b)


if((3^a)>(a+b) && 2>b)
a=2+b+b
a=a+2
a=1+a+a
return funn(a,b+a)-a
End if
return a+b-1

Answer:8
What will be the output of the following pseudocode a=2 b=0?

A) 3 B)2 C)4 D)1

Integer funn(Integer a, Integer b)


if((a-b)>(b&a) && (a^2)<(b+a))
b=1+2+b
a=2+1+b
b=(a+2)+a
return funn(b,b)+funn(a+1,b)
End if
return b+1
What will be the output of the following pseudocode a=2 b=0?

A) 3 B)2 C)4 D)1

Integer funn(Integer a, Integer b)


if((a-b)>(b&a) && (a^2)<(b+a))
b=1+2+b
a=2+1+b
b=(a+2)+a
return funn(b,b)+funn(a+1,b)
End if
return b+1

Answer:1
What will be the output of the following pseudocode for a=7 b=6 c=10?

A)19 B)35 C)26 D)23

Integer funn(Integer a, Integer b, Integer c)


if((b^8)<(5+b))
c=b+b
a=8+a
End if
return a+b+c
What will be the output of the following pseudocode for a=7 b=6 c=10?

A)19 B)35 C)26 D)23

Integer funn(Integer a, Integer b, Integer c)


if((b^8)<(5+b))
c=b+b
a=8+a
End if
return a+b+c

Answer:23
What will be the output of the following pseudocode for a=6, b=4?

A)14 B)6 C)-16 D)3

Integer funn(Integer a, Integer b)


if(b>a && a>3)
a=(b+1)+a
b=1+3+a
return a-funn(b,b)
End if
return b-1
What will be the output of the following pseudocode for a=6, b=4?

A)14 B)6 C)-16 D)3

Integer funn(Integer a, Integer b)


if(b>a && a>3)
a=(b+1)+a
b=1+3+a
return a-funn(b,b)
End if
return b-1

Answer:3
What will be the output of the following pseudocode?

A)24 B) 32 C) 45 D) 49

Integer a,b,c
Set a=2, b=7, c=9
If((9+c || (b&a)<a)
c=(b+1)+b
Else
a=a+c
b=5^b
End if
Print a+b+c
What will be the output of the following pseudocode?

A)24 B) 32 C) 45 D) 49

Integer a,b,c
Set a=2, b=7, c=9
If((9+c || (b&a)<a)
c=(b+1)+b
Else
a=a+c
b=5^b
End if
Print a+b+c

Answer:24
What will be the output of the following pseudocode for a=0, b=9?

A)13 B)15 C)17 D)24

Integer funn(Integer a, Integer b)


if((4&b)<(3-a) && (5-b)<(b-a))
b=(a+3)+a
b=a+1
a=3+2+a
return funn(a,a)+a
End if
return a+b
What will be the output of the following pseudocode for a=0, b=9?

A)13 B)15 C)17 D)24

Integer funn(Integer a, Integer b)


if((4&b)<(3-a) && (5-b)<(b-a))
b=(a+3)+a
b=a+1
a=3+2+a
return funn(a,a)+a
End if
return a+b

Answer:15
What will be the output of the following pseudocode?

A)35 B)27 C)20 D)19

Integer p,q,r
Set p = 1, q=5, r=4
If((q&p)<r)
p=(r+q)+q
End if
If((q+r)>(p-q) && 1<p
p=(r&q)+r
Else
q=4+r
End if
P=(r+7)+r
Print p+q+r
What will be the output of the following pseudocode?

A)35 B)27 C)20 D)19

Integer p,q,r
Set p = 1, q=5, r=4
If((q&p)<r)
p=(r+q)+q
End if
If((q+r)>(p-q) && 1<p
p=(r&q)+r
Else
q=4+r
End if
P=(r+7)+r
Print p+q+r
What will be the output of the following pseudocode a=3, b=4?

A)139 B)144 C)134 D)154

Integer funn(Integer a, Integer b)


if((b-a)>(a-b) && (4&a)>(a-4))
a=b+3
b=2+1+a
b=2+a+b
return funn(a,b)+b
End if
return a+b
What will be the output of the following pseudocode a=3, b=4?

A)139 B)144 C)134 D)154

Integer funn(Integer a, Integer b)


if((b-a)>(a-b) && (4&a)>(a-4))
a=b+3
b=2+1+a
b=2+a+b
return funn(a,b)+b
End if
return a+b

Answer:139
What will be the output of the following pseudocode?

A) 251 B)97 C) 105 D) 38

Integer pp,qq,rr
Set pp=3, qq=5, rr=4
qq=(1+5)+qq
if((qq+pp)<pp || (9+3)<qq)Else
qq=(qq+rr)+rr if((qq-op)>(pp-qq))
if((qq+pp)<(rr-qq)) pp = (99+qq)+pp
qq=(gq+rr)+rr7 rr=(pp+11)+pp
End if End
pp=rr+rr rr(2+12)+pp
End if
End if
Print,pp+qq+r
What will be the output of the following pseudocode?

A) 251 B)97 C) 105 D) 38

Integer pp,qq,rr
Set pp=3, qq=5, rr=4
qq=(1+5)+qq
if((qq+pp)<pp || (9+3)<qq)Else
qq=(qq+rr)+rr if((qq-op)>(pp-qq))
if((qq+pp)<(rr-qq)) pp = (99+qq)+pp
qq=(gq+rr)+rr7 rr=(pp+11)+pp
End if End
pp=rr+rr rr(2+12)+pp
End if
End if
Print,pp+qq+r
What will be the output of the following pseudocode for a=9 b=8?

A)-1 B)15 C)3 D)-4

Integer funn(Integer a, Integer b)


if(b>6 && b<a)
b=2+1+a
a=b+2
b=2+a+b
return a-funn(a,b)
End if
return b-a+1
What will be the output of the following pseudocode for a=9 b=8?

A)-1 B)15 C)3 D)-4

Integer funn(Integer a, Integer b)


if(b>6 && b<a)
b=2+1+a
a=b+2
b=2+a+b
return a-funn(a,b)
End if
return b-a+1

Answer:-1
What will be the output of the following pseudocode for a=6 b=3 c=4?

A)56 B)63 c)52 D)48

Integer funn(Integer a, Integer b, Integer c)


c=(c+c)+a
a=(1+11)+a
a=a+b
b=(a+4)&a
return a+b+c
What will be the output of the following pseudocode for a=6 b=3 c=4?

A)56 B)63 c)52 D)48

Integer funn(Integer a, Integer b, Integer c)


c=(c+c)+a
a=(1+11)+a
a=a+b
b=(a+4)&a
return a+b+c

Answer:52
What will be the output of the following pseudocode?

A)29 B)17 C)32 D)22

Integer a,b,c
Set a=7, b=3, c=4
b=(a+a)+a
for(each c from 5 to 7)
a=11^b
End for
a=(c&1)&b
Print a+b+c
What will be the output of the following pseudocode?

A)29 B)17 C)32 D)22

Integer a,b,c
Set a=7, b=3, c=4
b=(a+a)+a
for(each c from 5 to 7)
a=11^b
End for
a=(c&1)&b
Print a+b+c

Answer:29
What will be the output of the following pseudocode?

A)11 B)16 C)27 D)8

Integer a,b,c
Set a=6, b=2, c=9
a=a+b
for(each c from 4 to 6)
a=3+c
End for
Print a+b
What will be the output of the following pseudocode?

A)11 B)16 C)27 D)8

Integer a,b,c
Set a=6, b=2, c=9
a=a+b
for(each c from 4 to 6)
a=3+c
End for
Print a+b

Answer: 11
What will be the output of the following pseudocode for a=1 b=8?

A)-48 B)-43 C)-46 D)-37

Integer funn(Integer a, Integer b)


if((a^b)>(3-a) && (a-2)<(b&6))
b=1+3+b
a=b+1
b=3+a+a
return a-funn(b,b)
End if
b=a+2
return a+b-1
What will be the output of the following pseudocode for a=1 b=8?

A)-48 B)-43 C)-46 D)-37

Integer funn(Integer a, Integer b)


if((a^b)>(3-a) && (a-2)<(b&6))
b=1+3+b
a=b+1
b=3+a+a
return a-funn(b,b)
End if
b=a+2
return a+b-1

Answer: -46
What will be the output of the following pseudocode?

A)74 B)62 C)58 D)65

Integer p,q,r
Set p = 2, q=4, r=5
for(each r from 2 to 4
if(r<q && (r+q)<(6-r))
p=(q+7)+p
End if
if((p+r+q)>(q-p))
q=(q+8)+p
End if
q=(q+5)+p
End for
Print p+q+r
What will be the output of the following pseudocode?

A)74 B)62 C)58 D)65

Integer p,q,r
Set p = 2, q=4, r=5
for(each r from 2 to 4
if(r<q && (r+q)<(6-r))
p=(q+7)+p
End if
if((p+r+q)>(q-p))
q=(q+8)+p
End if
q=(q+5)+p
End for
Print p+q+r
What will be the output of the following pseudocode?

A)20 B)27 C)30 D)35

Integer p,q,r
Set p = 1, q=5, r=4
If((q&p)<r)
p=(r+q)+q
End if
if((q+r)>(p-q) && 1<p)
p=(r&q)+r
Else
q=4+r
End if
p=(r+7)+r
Print p+q+r
What will be the output of the following pseudocode?

A)20 B)27 C)30 D)35

Integer p,q,r
Set p = 1, q=5, r=4
If((q&p)<r)
p=(r+q)+q
End if
if((q+r)>(p-q) && 1<p)
p=(r&q)+r
Else
q=4+r
End if
p=(r+7)+r
Print p+q+r
What will be the output of the following pseudocode?

A)38 B)23 C)58 D) 45

Integer p,q,r
Set p=1, q=5, r=10
r=(r&q)^q
q=11+q
r=(4+1)+q
Print p+q+r
What will be the output of the following pseudocode?

A)38 B)23 C)58 D) 45

Integer p,q,r
Set p=1, q=5, r=10
r=(r&q)^q
q=11+q
r=(4+1)+q
Print p+q+r

Answer: 38
What will be the output of the following pseudocode?

A)16 B)6 C)23 D)13

Integer a,b,c
Set a=3, b=4, c=10
c=1+b
if((a+b+c)<(c+1))
if((a+b+c)<(c+a))
a=(c+7)+a
Else
b=(a+5)+c
End if
a=4+b
Else
c=2+b
What will be the output of the following pseudocode?

A)16 B)6 C)23 D)13

Integer a,b,c
Set a=3, b=4, c=10
c=1+b
if((a+b+c)<(c+1))
if((a+b+c)<(c+a))
a=(c+7)+a
Else
b=(a+5)+c
End if
a=4+b
Else
c=2+b
What will be the output of the following pseudocode?

A) 45 B) 87 C) 56 D) 54

Integer a,b,c
Set a=2, b=4, c=7
b=7+a
if(c>b)
b=b+b
End if
b=6+a
If((a+b)<(b-a) || c<a)
b=(c+4)+c
Else
a=c+b
End if
What will be the output of the following pseudocode?

A) 45 B) 87 C) 56 D) 54

Integer a,b,c
Set a=2, b=4, c=7
b=7+a
if(c>b)
b=b+b
End if
b=6+a
If((a+b)<(b-a) || c<a)
b=(c+4)+c
Else
a=c+b
End if
What will be the output of the following pseudocode?

A)21 B) 28 C) 45 D) 34

Integer a,b,c Else


Set a=3, b=4, c=10 a=(8+5)+a
A=10+b End if
If((a+b+c)<(b+c+a)) b=(2+2)+b
a=(3+9)+c Else
if((b+a+7)<(5+c+b)) if((b+c)<(c-b))
c=(b+11)+c b=(a+b)+b
c=c+b
End if
a=10+b
End if
Print a+b+c
What will be the output of the following pseudocode?

A)21 B) 28 C) 45 D) 34

Integer a,b,c Else


Set a=3, b=4, c=10 a=(8+5)+a
A=10+b End if
If((a+b+c)<(b+c+a)) b=(2+2)+b
a=(3+9)+c Else
if((b+a+7)<(5+c+b)) if((b+c)<(c-b))
c=(b+11)+c b=(a+b)+b
c=c+b
End if
a=10+b
End if
Print a+b+c
What will be the output of the following pseudocode?

A)48 B)44 C) 56 D) 41

Integer p,q,r
Set p=9, q=5, r=4
p=p+q
If((p+q+r)<(r+q+p))
q=(r+r)+r if((p+5+r)<(8+p))
if((r+p+q)<(q+r)) p=(2+1)+p
q=(r+q)+r p=(7+4)+p
Else End if
r=11+r End if
End if Print p+q+r
Else
q=12+p
What will be the output of the following pseudocode?

A)48 B)44 C) 56 D) 41

Integer p,q,r
Set p=9, q=5, r=4
p=p+q
If((p+q+r)<(r+q+p))
q=(r+r)+r if((p+5+r)<(8+p))
if((r+p+q)<(q+r)) p=(2+1)+p
q=(r+q)+r p=(7+4)+p
Else End if
r=11+r End if
End if Print p+q+r
Else
q=12+p Answer: 44
What will be the output of the following pseudocode?

A) 31 B) 36 C) 67 D) 47

Integer p,q,r
Set p = 9, q=5, r=8
for(each r from 5 to 6)
if((p+r)<(r-p) || q<p)
q=p+r
End if
if((r&3)<p)
p=p^r
continue
End if
p=p+p
End for
What will be the output of the following pseudocode?

A) 31 B) 36 C) 67 D) 47

Integer p,q,r
Set p = 9, q=5, r=8
for(each r from 5 to 6)
if((p+r)<(r-p) || q<p)
q=p+r
End if
if((r&3)<p)
p=p^r
continue
End if
p=p+p
End for
What will be the output of the following pseudocode?

A) 25 B) 80 C) 65 D) 37

Integer p,q,r
Set p=3, q=5, r=4
q=(12+4)+r
if((1+6+p)<(8+q))
r=(p+1)+p
if((p+q)<r)
p=(r+r)+q
Else
r=(r+q)+r
End if
r=(r+p)+q
End if
What will be the output of the following pseudocode?

A) 25 B) 80 C) 65 D) 37

Integer p,q,r
Set p=3, q=5, r=4
q=(12+4)+r
if((1+6+p)<(8+q))
r=(p+1)+p
if((p+q)<r)
p=(r+r)+q
Else
r=(r+q)+r
End if
r=(r+p)+q
End if
What will be the output of the following pseudocode?

A) 33 B)63 C)45 D)52

Integer p,q,r
Set p=3, q=4, r=10
if((q+r+5)<(r+p+q))
p=r+p
if((p+r+q)<(r+q-p))
r=(r+4)+q
r=p+r
Else
End if
Elseif((2+q)+(6+p)>(r+p))
r=(r+12)+r
r=(p+p)+r
What will be the output of the following pseudocode?

A) 33 B)63 C)45 D)52

Integer p,q,r
Set p=3, q=4, r=10
if((q+r+5)<(r+p+q))
p=r+p
if((p+r+q)<(r+q-p))
r=(r+4)+q
r=p+r
Else
End if
Elseif((2+q)+(6+p)>(r+p))
r=(r+12)+r
r=(p+p)+r
What will be the output of the following pseudocode?

A) 25 B) 29 C) 28 D) 37

Integer p,q,r
Set p=6, q=2, r=9
q=4^r
for (each r from 4 to 6)
q=r+r
End for
q=(p^q)+g
Print p+q
What will be the output of the following pseudocode?

A) 25 B) 29 C) 28 D) 37

Integer p,q,r
Set p=6, q=2, r=9
q=4^r
for (each r from 4 to 6)
q=r+r
End for
q=(p^q)+g
Print p+q

Answer: 28
What will be the output of the following pseudocode?

A) 2 B)-2 C) 16 D) 7
Integer funn (Integer a, Integer b)
if(a<7 && (b-5)>(a&b))
a=b+2
a=1+a+a
a=b+2
return funn (b+b, a)+a+funn (a,b)
End if
return b-a
What will be the output of the following pseudocode?

A) 2 B)-2 C) 16 D) 7
Integer funn (Integer a, Integer b)
if(a<7 && (b-5)>(a&b))
a=b+2
a=1+a+a
a=b+2
return funn (b+b, a)+a+funn (a,b)
End if
return b-a

Answer: 2
What will be the output of the following pseudocode?

A) 23 B)15 C) 37 D)19

Integer p,q,r
Set p=1, q=8, r=8
r=(p^q)^p
r=(p+q)+p
Print p+q+r
What will be the output of the following pseudocode?

A) 23 B)15 C) 37 D)19

Integer p,q,r
Set p=1, q=8, r=8
r=(p^q)^p
r=(p+q)+p
Print p+q+r

Answer: 19
What will be the output of the following pseudocode?

A) 17 B)10 C) 20 D)23

Integer p, q, r
Set p=5, q=6, r = 9
if(5<r|| (r * 8p) < p )
r = 12 + p
End if
r = (p + 11) + p
if((p + r) > (q - p))
r=r+r
End if
r=3+q^5
Print p + q +r
What will be the output of the following pseudocode?

A) 17 B)10 C) 20 D)23

Integer p, q, r
Set p=5, q=6, r = 9
if(5<r|| (r * 8p) < p )
r = 12 + p
End if
r = (p + 11) + p
if((p + r) > (q - p))
r=r+r
End if
r=3+q^5
Print p + q +r
What will be the output of the following pseudocode?

A) 12 B)8 C) 11 D)4

Integer funn(Integer a, Integer b)


if((5-a)>(a-b) && (1-a)>(a-b))
a=(b+3)+b
a=3+b+b
b=b+1
return funn(a,a)+funn(a, b+a)
End if
return a+b-1
What will be the output of the following pseudocode?

A) 12 B)8 C) 11 D)4

Integer funn(Integer a, Integer b)


if((5-a)>(a-b) && (1-a)>(a-b))
a=(b+3)+b
a=3+b+b
b=b+1
return funn(a,a)+funn(a, b+a)
End if
return a+b-1

Answer: 4
What will be the output of the following pseudocode?

A) 23 B) 6 C) 16 D) 13

Integer a,b,c
Set a=3, b=4, c=10
c=1+b
if((a+b+c)<(c+1))
if((a+b+c)<(c+a))
a=(c+7)+a
Else
b=(a+5)+c
End if
a=4+b
Else
c=2+b
What will be the output of the following pseudocode?

A) 23 B) 6 C) 16 D) 13

Integer a,b,c
Set a=3, b=4, c=10
c=1+b
if((a+b+c)<(c+1))
if((a+b+c)<(c+a))
a=(c+7)+a
Else
b=(a+5)+c
End if
a=4+b
Else
c=2+b
What will be the output for the code?

A) 13 B) 66 C) 19 D) 47

Integer a, b, c
Set a = 3, b = 4, c = 10
c=1+b
if ((a + b + c) < (c + 1))
if ((a + b + c) < (c + a))
a = (c + 7) + a
Else
b = (a + 5) + c
End if
a=4+b
Else
c=2+b
What will be the output for the code?

A) 13 B) 66 C) 19 D) 47

Integer a, b, c
Set a = 3, b = 4, c = 10
c=1+b
if ((a + b + c) < (c + 1))
if ((a + b + c) < (c + a))
a = (c + 7) + a
Else
b = (a + 5) + c
End if
a=4+b
Else
c=2+b
What will be the output for the code a = 1 , b= 8?

A) 23 B) 13 C) 19 D) 27

Function fun(a, b)
if ((a ^ b) > (3 - a) && (a - 2) < (b & 6))
b=1+3+b
a=b+1
b=3+a+a
return a - fun(b, b)
End if
b=a+2
return a + b – 1
What will be the output for the code a = 1 , b= 8?

A) 23 B) 13 C) 19 D) 27

Function fun(a, b)
if ((a ^ b) > (3 - a) && (a - 2) < (b & 6))
b=1+3+b
a=b+1
b=3+a+a
return a - fun(b, b)
End if
b=a+2
return a + b – 1

Answer: 13
What will be the output for the code a= 7 , b= 6, c=10?

A) 26 B) 35 C) 20 D) 23

Integer funn(Integer a, Integer b, Integer c)


if ((b ^ 8) < (5 + b))
c=b+b
a=8+a
End if
return a + b + c
End Function
What will be the output for the code a= 7 , b= 6, c=10?

A) 26 B) 35 C) 20 D) 23

Integer funn(Integer a, Integer b, Integer c)


if ((b ^ 8) < (5 + b))
c=b+b
a=8+a
End if
return a + b + c
End Function

Answer: 20
What will be the output for the code ?

A) 8 B) 16 C) 11 D) 27

Integer a, b, c
Set a = 6, b = 2, c = 9
a=a+b
for (each c from 4 to 6)
a=3+c
End for
Print (a + b)
What will be the output for the code ?

A) 8 B) 16 C) 11 D) 27

Integer a, b, c
Set a = 6, b = 2, c = 9
a=a+b
for (each c from 4 to 6)
a=3+c
End for
Print (a + b)

Answer: 11
What will be the output for the code ?

A) 41 B) 35 C) 20 D) 23

Integer a, b, c
Set a = 2, b = 4, c = 7
b= 7 + a
if (c > b)
b=b+b
End if
b=6+a
if ((a + b) < (b - a) || c<a)
b=(c+4)+c
Else
a=c+b
End if
What will be the output for the code ?

A) 41 B) 35 C) 20 D) 23

Integer a, b, c
Set a = 2, b = 4, c = 7
b= 7 + a
if (c > b)
b=b+b
End if
b=6+a
if ((a + b) < (b - a) || c<a)
b=(c+4)+c
Else
a=c+b
End if
What will be the output of the following pseudocode?

A) 125 B) 129 C) 058 D) 171

Integer a,b,c
Set a=9, b=5, c=8
for (each c from 4 to 8 )
b=(a+2)+c
if(5<b && (2+8)<(10+c))
a=(4^5)+a
if((b+c-a)>(a+b))
b=(c+b)&a
Jump out of the loop
Else
b=(c+c)+a
End if
What will be the output of the following pseudocode?

A) 125 B) 129 C) 058 D) 171

Integer a,b,c
Set a=9, b=5, c=8
for (each c from 4 to 8 )
b=(a+2)+c
if(5<b && (2+8)<(10+c))
a=(4^5)+a
if((b+c-a)>(a+b))
b=(c+b)&a
Jump out of the loop
Else
b=(c+c)+a Answer: 171
End if
What will be the output for the code ?

A) 17 B) 32 C) 22 D) 21

Integer a, b, c
a=7
b=3
c=4
b = (a + a) + a
for (each c from 5 to 7)
a = 11 ^ b
End for
a = (c & 1) & b
Print (a + b)
What will be the output for the code ?

A) 17 B) 32 C) 22 D) 21

Integer a, b, c
a=7
b=3
c=4
b = (a + a) + a
for (each c from 5 to 7)
a = 11 ^ b
End for
a = (c & 1) & b
Print (a + b)

Answer: 21
What will be the output for the code ?

A) A) 1717 B) B) 3232 C) C) 3434 D) 21

Integer pp, qq, rr


pp = 2
qq = 3
rr = 9
qq = rr + qq
if ((pp ^ qq ^ rr) < (qq + rr & pp))
pp = 2 & rr
Else
if (8 < rr)
rr = (4 ^ 1) + qq
Else
rr = (pp + 10) & rr
What will be the output for the code ?

A) A) 1717 B) B) 3232 C) C) 3434 D) 21

Integer pp, qq, rr


pp = 2
qq = 3
rr = 9
qq = rr + qq
if ((pp ^ qq ^ rr) < (qq + rr & pp))
pp = 2 & rr
Else
if (8 < rr) Answer: 34
rr = (4 ^ 1) + qq
Else
rr = (pp + 10) & rr
What will be the output for the code a= 3, b=4 ?

A) 139 B) 32 C) 16 D) 41

Integer funn(Integer a, Integer b)


if ((b - a) > (a - b) && (4& a) > (a - 4))
a=b+3
b=2+1+a
b=2+a+b
return funn(a, b) + b
End if
return a + b
What will be the output for the code a= 3, b=4 ?

A) 139 B) 32 C) 16 D) 41

Integer funn(Integer a, Integer b)


if ((b - a) > (a - b) && (4& a) > (a - 4))
a=b+3
b=2+1+a
b=2+a+b
return funn(a, b) + b
End if
return a + b

Answer: 139
What will be the output for the code?

A) 945 B) 943 C) 963 D) 938

Integer p, q, r
Set p = 5, q = 4, r = 9
r = (r + p) + r
for (each r from 2 to 3)
p = (q + 7) + p
q=q+p
End for
p = (q + 3) + q
for (each r from 5 to 7)
p = (6 + 11) + q
q=p+q
End for
What will be the output for the code?

A) 945 B) 943 C) 963 D) 938

Integer p, q, r
Set p = 5, q = 4, r = 9
r = (r + p) + r
for (each r from 2 to 3)
p = (q + 7) + p
q=q+p
End for
p = (q + 3) + q
for (each r from 5 to 7)
p = (6 + 11) + q
q=p+q
End for
What will be the output for the code?

A) 7 B) 26 C) 11 D) 19

Integer pp, qq, rr


Set pp = 3, qq = 5, rr = 7
for (each rr from 4 to 5)
pp = pp + qq
qq = (11 & 7) + qq
End for
pp = 2 & pp
Print (pp + qq)
What will be the output for the code?

A) 7 B) 26 C) 11 D) 19

Integer pp, qq, rr


Set pp = 3, qq = 5, rr = 7
for (each rr from 4 to 5)
pp = pp + qq
qq = (11 & 7) + qq
End for
pp = 2 & pp
Print (pp + qq)

Answer: 11
What will be the output for the code a=3 and b=4?

A) 25 B) 30 C) 20 D) 47

Integer funn(Integer a, Integer b)


if (b < 7 && (a - b) < (b & a))
b=2+2+a
a=1+1+a
b=2+b+b
return b + funn(b, a) - a + 2
End if
return a + 1
What will be the output for the code a=3 and b=4?

A) 25 B) 30 C) 20 D) 47

Integer funn(Integer a, Integer b)


if (b < 7 && (a - b) < (b & a))
b=2+2+a
a=1+1+a
b=2+b+b
return b + funn(b, a) - a + 2
End if
return a + 1

Answer: 30
What will be the output for the code a =2 b =1?

A) 2 B) 8 C) -1 D) 7

Function funn(Integer a, Integer b)


if ((5 - a) > (a - b) && (b & a))
a = (a + 1) + a
b=b+2
b=2+a+b
return b - funn(b + 1, b) + 1
End if
return a
What will be the output for the code a =2 b =1?

A) 2 B) 8 C) -1 D) 7

Function funn(Integer a, Integer b)


if ((5 - a) > (a - b) && (b & a))
a = (a + 1) + a
b=b+2
b=2+a+b
return b - funn(b + 1, b) + 1
End if
return a

Answer: 2
What will be the output for the code a=3,b=1?

A)3 B) 1 C) 6 D) -2

Function funn(Integer a, Integer b)


if (b < 4 && 1 > a)
a=a+1
a = (a + 3) + a
return funn(a, b + a)
End if
return a - b + 1
What will be the output for the code a=3,b=1?

A)3 B) 1 C) 6 D) -2

Function funn(Integer a, Integer b)


if (b < 4 && 1 > a)
a=a+1
a = (a + 3) + a
return funn(a, b + a)
End if
return a - b + 1

Answer: 3
What will be the output for the code ?

A) 19 B)15 C) 27 D) 18

Integer a, b, c
Set a = 6, b = 2, c = 9
c = (c + a) + b
for (each c from 2 to 4)
a = (4 ^ 10) + b
End for
Print (a + b)
What will be the output for the code ?

A) 19 B)15 C) 27 D) 18

Integer a, b, c
Set a = 6, b = 2, c = 9
c = (c + a) + b
for (each c from 2 to 4)
a = (4 ^ 10) + b
End for
Print (a + b)

Answer: 18
What will be the output for the code ?

A) 23 B)20 C) 24 D) 11

Integer funn (Integer a, Integer b)


if(4>b && (b&a)<(a+b))
a=2+a+b
b=a+2
return a+funn(a,a)
End if
a=3+2+a
return a+b
What will be the output for the code ?

A) 23 B)20 C) 24 D) 11

Integer funn (Integer a, Integer b)


if(4>b && (b&a)<(a+b))
a=2+a+b
b=a+2
return a+funn(a,a)
End if
a=3+2+a
return a+b

Answer: 11
What will be the output for the code a = 9 , b= 2 ?

A) -8 B) -19 C) -14 D) -6

Integer funn(Integer a, Integer b)


if (4 & a) < (3 - b) and (a ^ b) > (3 - a)
b=2+2+b
b=2+1+a
return funn(b + b, a)
End if
return b - a + 1
What will be the output for the code a = 9 , b= 2 ?

A) -8 B) -19 C) -14 D) -6

Integer funn(Integer a, Integer b)


if (4 & a) < (3 - b) and (a ^ b) > (3 - a)
b=2+2+b
b=2+1+a
return funn(b + b, a)
End if
return b - a + 1

Answer: -6
What will be the output for the code ?

A) 32 B)25 C) 28 D) 43

Integer pp, qq, rr


Set pp = 4, qq = 6, rr = 6
qq = rr + pp
if ((pp - qq) > (q + pp) || 6 > qq)
qq = (rr + 1) & pp
End if
pp = rr + pp
if ((qq - 7) < (7 + qq))
pp = 6 + rr
End if
Print (pp + qq + rr)
What will be the output for the code ?

A) 32 B)25 C) 28 D) 43

Integer pp, qq, rr


Set pp = 4, qq = 6, rr = 6
qq = rr + pp
if ((pp - qq) > (q + pp) || 6 > qq)
qq = (rr + 1) & pp
End if
pp = rr + pp
if ((qq - 7) < (7 + qq))
pp = 6 + rr
End if
Print (pp + qq + rr)
What will be the output for the code a= 6 b=3 ?

A) 18 B) 19 C) 1 D) 9

Function funn(Integer a, Integer b)


if ((b * 8 * a) < (a - b) * 8 && (a > 3))
b=b+3
b=a+3
b = (b + 1) + a
return funn(a + 1, b) + funn(a + b, b)
End if
b=1+b+b
return b - a
End Function
What will be the output for the code a= 6 b=3 ?

A) 18 B) 19 C) 1 D) 9

Function funn(Integer a, Integer b)


if ((b * 8 * a) < (a - b) * 8 && (a > 3))
b=b+3
b=a+3
b = (b + 1) + a
return funn(a + 1, b) + funn(a + b, b)
End if
b=1+b+b
return b - a
End Function

Answer: 1
What will be the output for the code a= 9 b=6,c=7 ?

A) 40 B) 50 C) 52 D) 44

Function funn(Integer a, Integer b, Integer c)


if ((2 + c + b) < (8 + b + a))
a=a&a
Else
c=b+b
End if
b = (c + 12) + a
return a + b + c
What will be the output for the code a= 9 b=6,c=7 ?

A) 40 B) 50 C) 52 D) 44

Function funn(Integer a, Integer b, Integer c)


if ((2 + c + b) < (8 + b + a))
a=a&a
Else
c=b+b
End if
b = (c + 12) + a
return a + b + c

Answer: 44
What will be the output for the code a=9 b=8?

A) 15 B) -4 C) 3 D) -1

Function funn(Integer a, Integer b)


if (b > 6 && b < a)
b=2+1+a
a=b+2
b=2+a+b
return a - funn(a, b)
End if
return b - a + 1
What will be the output for the code a=9 b=8?

A) 15 B) -4 C) 3 D) -1

Function funn(Integer a, Integer b)


if (b > 6 && b < a)
b=2+1+a
a=b+2
b=2+a+b
return a - funn(a, b)
End if
return b - a + 1

Answer: 15
What will be the output for the code a= 7 , b= 8?

A) -2 B) -17 C) -12 D)-10

def funn(a, b):


if (a - 6) > (b & a) and (4 & a) > (a - 4):
a=a+1
b=1+2+a
b=3+b+a
return funn(a, a) + funn(b, b) + b
End if
a=2+b+b
return b - a
What will be the output for the code a= 7 , b= 8?

A) -2 B) -17 C) -12 D)-10

def funn(a, b):


if (a - 6) > (b & a) and (4 & a) > (a - 4):
a=a+1
b=1+2+a
b=3+b+a
return funn(a, a) + funn(b, b) + b
End if
a=2+b+b
return b - a

Answer: -10
What will be the output for the code?

A) 32 B) 37 C) 25 D) 30

Integer a, b, c
Set a = 3, b = 5, c = 7
if ((a ^ c) < b)
a=a+c
End if
c = (5 + 3) + c
Print a + b + c
What will be the output for the code?

A) 32 B) 37 C) 25 D) 30

Integer a, b, c
Set a = 3, b = 5, c = 7
if ((a ^ c) < b)
a=a+c
End if
c = (5 + 3) + c
Print a + b + c

Answer: 30
What will be the output for the code ?

A) 58 B) 48 C) 31 D) 53

Integer p,q,r
Set p 5, q=2, r«7
if((q&p&r)<(r&q))A
r=1+r
Else
r=r+r
End if
p=(p+r)^p
if((p-q)<(r+p))
End if
Print p+q+r
What will be the output for the code ?

A) 58 B) 48 C) 31 D) 53

Integer p,q,r
Set p 5, q=2, r«7
if((q&p&r)<(r&q))A
r=1+r
Else
r=r+r
End if
p=(p+r)^p
if((p-q)<(r+p))
End if
Print p+q+r
What will be the output for the code ?

A) 45 B) 66 C) 50 D) 48

Integer pp, qq,rr


Set pp=9, qq=4, rr=5
rr=rr&rr
for(each rr from 4 to 7)
pp=(pp^rr)+rr
pp=(pp rr)+rr
End for
pp=(21)+pp
Print pp+qq
What will be the output for the code ?

A) 45 B) 66 C) 50 D) 48

Integer pp, qq,rr


Set pp=9, qq=4, rr=5
rr=rr&rr
for(each rr from 4 to 7)
pp=(pp^rr)+rr
pp=(pp rr)+rr
End for
pp=(21)+pp
Print pp+qq

Answer: 48
What will be the output for the code ?

A) 19 B) 16 C)26 D) 18

Integer p,q,r
Set p=7, q=3, r=6
for(each r from 4 to 6 )
q=(9&12)^rq=(r^q)+r
End for
q=4+p
Print p+q
What will be the output for the code ?

A) 19 B) 16 C)26 D) 18

Integer p,q,r
Set p=7, q=3, r=6
for(each r from 4 to 6 )
q=(9&12)^rq=(r^q)+r
End for
q=4+p
Print p+q

Answer: 18
What will be the output for the code a = 2 , b=0 ?

A) 41 B) 30 C) 20 D) 23

Function funn(Integer a, Integer b)


if ((a - b) > (b & a) && (a ^ 2) < (b + a))
b=1+2+b
a=2+1+b
b = (a + 2) + a
return funn(b, b) + funn(a + 1, b)
End if
return b + 1
What will be the output for the code a = 2 , b=0 ?

A) 41 B) 30 C) 20 D) 23

Function funn(Integer a, Integer b)


if ((a - b) > (b & a) && (a ^ 2) < (b + a))
b=1+2+b
a=2+1+b
b = (a + 2) + a
return funn(b, b) + funn(a + 1, b)
End if
return b + 1

Answer: 30

You might also like