Pseudo Code
Pseudo Code
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?
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?
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?
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?
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?
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?
Answer: 63
What will be the output of the following pseudo code?
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?
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?
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?
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?
Answer: 31
What will be the output of the following pseudocode for a=5, b=2?
Answer: 4
What will be the output of the following pseudocode?
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?
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?
Answer: 12
What will be the output of the following pseudocode a=5, b=2?
Answer: 7
What will be the output of the following pseudo code for a=9, b=8?
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?
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?
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?
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?
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?
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?
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?
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?
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?
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?
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?
Answer:39
What will be the output of the following pseudocode?
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?
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?
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?
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?
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
A) 35 B) 43 C) 39 D)31
Answer: 31
What will be the output of the following pseudocode a=8 b=7?
A) 14 B) 15 C) 17 D) 18
A) 14 B) 15 C) 17 D) 18
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
A) 45 B) 56 C) 46 D) 55
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?
Answer: -46
What will be the output of the following pseudocode?
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?
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?
Answer:8
What will be the output of the following pseudocode a=2 b=0?
Answer:1
What will be the output of the following pseudocode for a=7 b=6 c=10?
Answer:23
What will be the output of the following pseudocode for a=6, b=4?
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?
Answer:15
What will be the output of the following pseudocode?
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?
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?
Answer:139
What will be the output of the following pseudocode?
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?
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?
Answer:-1
What will be the output of the following pseudocode for a=6 b=3 c=4?
Answer:52
What will be the output of the following pseudocode?
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?
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?
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?
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?
Answer: -46
What will be the output of the following pseudocode?
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?
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?
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?
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?
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?
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?
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?
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
A)21 B) 28 C) 45 D) 34
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?
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?
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
A) 12 B)8 C) 11 D)4
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
A) 26 B) 35 C) 20 D) 23
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?
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?
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) 139 B) 32 C) 16 D) 41
A) 139 B) 32 C) 16 D) 41
Answer: 139
What will be the output for the code?
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?
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
A) 7 B) 26 C) 11 D) 19
Answer: 11
What will be the output for the code a=3 and b=4?
A) 25 B) 30 C) 20 D) 47
A) 25 B) 30 C) 20 D) 47
Answer: 30
What will be the output for the code a =2 b =1?
A) 2 B) 8 C) -1 D) 7
A) 2 B) 8 C) -1 D) 7
Answer: 2
What will be the output for the code a=3,b=1?
A)3 B) 1 C) 6 D) -2
A)3 B) 1 C) 6 D) -2
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
A) 23 B)20 C) 24 D) 11
Answer: 11
What will be the output for the code a = 9 , b= 2 ?
A) -8 B) -19 C) -14 D) -6
A) -8 B) -19 C) -14 D) -6
Answer: -6
What will be the output for the code ?
A) 32 B)25 C) 28 D) 43
A) 32 B)25 C) 28 D) 43
A) 18 B) 19 C) 1 D) 9
A) 18 B) 19 C) 1 D) 9
Answer: 1
What will be the output for the code a= 9 b=6,c=7 ?
A) 40 B) 50 C) 52 D) 44
A) 40 B) 50 C) 52 D) 44
Answer: 44
What will be the output for the code a=9 b=8?
A) 15 B) -4 C) 3 D) -1
A) 15 B) -4 C) 3 D) -1
Answer: 15
What will be the output for the code a= 7 , b= 8?
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
A) 45 B) 66 C) 50 D) 48
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
A) 41 B) 30 C) 20 D) 23
Answer: 30