Technical Question 7
Technical Question 7
Integer a,b,c
Set b=300,a=5,c=1
If(b>a)
b=a
else
a=b
end if
for(each b from 0 to 5)
a=a+1
end for
print a+c
A. 12
Integer a,b,c
set b=5,a=2,c=2
if(b>a||a>c||c>b)
b=a
else
a=b
end if
print a+b+c
Ans:6
Integer a,b,c
Set b=4,a=2,c=2
b=a
else
a=b
end if
print a+b+c
Ans: 6
Integer calculate(Integer b)
if(b EQUALS 1)
return 0
else
Ans :20
VALIDATE_DATA
Number =90
else
end-if
A. Data within the range will get displayed
Set a=6,b=3,c=2
b=a+1
else
a=b+1
end if
print a+b+c
Ans : 9
Integer i,j,k,n
set j=1,k=1
for(each i from 1 to 5)
print k
j=j+1
k=k+j
end for
A. 1 3 6 10 15
B. 1 2 3 4 5
C. 4 6 8 10
D. 1 1 2 3 5
8. What will be the output of the following pseudocode if a=10 and b=6?
Integer func(Integer a, Integer b)
Integer temp
While(b)
temp =a MOD b
a=b
b=temp
End while
return a
A.2
B.4
C.3
D.1
Integer i,j,k
Set k=6
print k+1
End for
End for
A. 2
B. 6
C. 7
D. 5
Integer a,b,c
Set b=4,a=2,c=2
b=a
else
a=b
end if
print a+b+c
Ans: 10