Accenture PSEUDOCODE Questions
Accenture PSEUDOCODE Questions
FUNCTION calculate(x, y)
Z=x*y
RETURN z- x
END FUNCTION
Result = calculate(4, 5)
DISPLAY result
Select the correct answer from the given choices.
a. 16
b. 17
c. 18
d. 19
11. What will be the output of the following pseudo code for a=2, b=8. c=8?
Integer funn(Integer a, Integer b, Integer c)
C=9+a
if((4+10+a)<(7+c))
if((7+6)<c)
if((S+c)<(b+5))
b=a+b
End if
End if
End If
Print a+b+c
Select the correct option from the given choices.
a. 17
b. 22
c. 21
d. 29
12. What will be the output of the following pseudo code?
Integer p,q,r
Set p=9,q=8,r=8
for(each r from 2 to 3)
p=(12^4)+q
p=q&q
End for
Q=3^p
Print p+q
Select the correct option from the given choices.
a. 8
b. 11
c. 16
d. 23
13. What will be the output of the following pseudo code for a=2, b=2, c=9?
Integer funn(Integer a, Integer b. Integer c)
for(each c from 4 to 6)
b=(11+11)+a
End for
for(each c from 2 to 5)
b=(c+6)&b
End for
Print a+b
Select the correct option from the given choices.
a. 7
b. 10
c. 15
d. 26
14. What will be the output of the following pseudo code for a=7. b=7. c=9?
Integer funn(Integer a, Integer b, Integer c)
A=8+c
if((9-9)>(a+9))
c=(2+10)+a
Else
if((b+a+c)<(a+c+b))
c=(c+c)+b
End if
a+b+c
End If
Print a+b+c
Select the correct option from the given choices.
a. 32
b. 36
c. 29
d. 44
17. What will be the output of the following pseudo code for a=3, b=2. c=6?
Integer funn(Integer a, Integer b, Integer c)
if((5-c-a)<(a+b))
if((a+c)+(c+b)>(a+c+b))
if((6+a)<(C+6))
a-5+a
Else
b-(c+11)+b
End if
End if
End If
return a+b+c
Select the correct option from the given choices.
a. 36
b. 20
c. -3
d. 16
27. What will be the output of the following pseudo code for a=4, b=5, c=6?
Integer funn(Integer a, Integer b, Integer c)
if((c+b)<(b-c) && 6>a)
if((c+a+b)<(5+b+9))
c=(a+3)+b
End if
C=a+a
End If
B=(c+10)+a
return a+b+c
Select the correct option from the given choices.
a. 28
b. 32
c. 30
d. 39
36. What will be the output of the following pseudo code for a=1, b=6 c=7?
Integer funn(Integer a, Integer b, Integer c)
if((a+8+c)<(6+a))
a=(a+b)+b
if((a+b+c)<(b+c+a))
a=c+c
Else
c=(c+a)+b
End if
c=7+b
End If
return a+b+c
Select the correct option from the given choices.
a 14
b 20
c 9
d 24
37. What will be the output of the following pseudo code for a = 5, b = 8, c = 6 ?
Integer funn(Integer a, Integer b, Integer c)
If((2 + c) < (a + 2))
a = (a + c) + c
Else
If((b + c) < (10 - b))
c=c+a
c = (1 + 4) + c
End if
b = (9 + 9) + c
End if
Print a+b+c
Select the correct option from the given choices.
a) 30
b) 39
c) 35
d) 43
38. What will be the output of the following pseudo code for a = 8, b=7, c=7?
Integer funn(Integer a, Integer b, Integer c)
if((3 + c + b) < (c + b + 3))
c=b+a
if((c + b) < (a + c))
if( (b + c + a) < (c + a + b) )
c = (12 + 1) + a
End if
End if
a=(a + a)+a
End if
Print a+b+c
Select the correct option from the given choices
a) 19
b) 22
c) 26
d) 37