28th August Batch Questions - Capgemini
1.
Integer a1,p1
set a1=15
a1 = a1-1
a1 = a1 * 2 + 8
a1 = a1 / 2 + 9 * 5
p1 = a1 / 5 + 6
print p1
- 19
- 3
- 23
- 18
Ans- 4
2.
Integer a, b, c
set a=1, b=1
for (each c from 4 to 7)
a= a - 1
if(a < 10)
a= a -1
continue
End if
a=a+2
End for
Print b+a
- 9
- 2
- -6
- 8
Ans- 3
3.
Integer a, b, c
set a=13, b=9, c=6
if(a<b)
if(a<c)
print a
else
print c
end if
else if (b<c)
print b
else
print c
end if
- 6 9
- 9
- 6
- 13
Ans- 4
4.
Integer number
set number = 1
do
print number
number = number + 1
print number + 1
while (number<=0)
end do while
print number
- 2 1 1
- 1 0 3
- 1 1 2
- 1 3 2
Ans- 4
5.
Integer a, b, c
set a=3, b=1
for (each c from b to a)
if (a+b > 0)
b=a
continue
End if
a = a+b
a = a-1
End for
Print a
- 2
- 1
- 3
- 8
Ans- 3
No comments:
Post a Comment