1. What will be the output of the following pseudo code?
Input m=9,n=6
m=m+1
n=n-1
m=m+n
if (m>n)
print m
else
print n
a) 6
b) 5
c) 10
d) 15
Answer: (D)
2. What will be the output of the following pseudo code?
Input f=6,g=9 and set sum=0
Integer n
if(g>f)
for(n=f;n<g;n=n+1)
sum=sum+n
End for loop
else
print error message
print sum
a) 21
b) 15
c) 9
d) 6
Answer:(A)
3. What will be the output of the following pseudo code statements?
interger a=456, b,c,d=10
c=a-b
print c
a)410
b)410.4
c)411.4
d)411
Answer: (d)
4. What will be the output of the following pseudo code statements?
integer a=984,b,c,d=10
print remainder(a,d)
print remainder(a,d)
a)48
b)Error
c)84
d)44
Answer:(a)
5. What will be the output of the following pseudo code statements?
interger a=50,b=25,c=0
print(a>45 OR b>50 AND c>10)
a)1
b)0
c)-1
d)10
Answer: (a)
6. What will be the output of the following pseudo code statements?
integer a=50,b=25,c=5
print a*b/c+c
a)120
b)125
c)255
d)250
Answer: (c)
7. What will be the output of the following pseudo code statements?
integer a=50,b=35,c=5
print a*b/c-c
a) 65
b) 60
c) Error
d) 70
Answer: (a)
8. Comment about the output of the two statements?
integer a=10,b=35,c=5
print a*b+c/d
print c/d+a*b
a) Differ due to left to right precedence
b) Differ by 10
c) Differ by 20
d) Same
Answer: (d)
9. Comment about the output of the two statements?
integer a=40,b=35,c=20, d=10
print a*b/c-d
print a*b/(c-d)
a) Differ by 80
b) Same
c) Differ by 50
d) Differ by 160
Answer: a)
10. What will be the output of the following pseudo code statements?
integer a=60,b=35, c=-30
print (a>45 Or b>50 AND c>10)
print((a>45 OR b>50) AND c>10)
a) 0 and 1
b) 0 and 0
c) 1 and 1
d) 1 and 0
Answer:d)