sayan bera


{ City } kolkata
< Country > india
* Profession *
User No # 63672
Total Questions Posted # 3
Total Answers Posted # 1

Total Answers Posted for My Questions # 19
Total Views for My Questions # 95540

Users Marked my Answers as Correct # 7
Users Marked my Answers as Wrong # 6
Questions / { sayan bera }
Questions Answers Category Views Company eMail

There are two boxes, one containing 10 red balls and the other containing 10 green balls. You are allowed to move the balls between the boxes so that when you choose a box at random and a ball at random from the chosen box, the probability of getting a red ball is maximized. This maximum probability is?? a)37/38 b)14/19 c)3/4 d)½

TCS,

5 General Aptitude 23085

6. A lady has fine gloves and hats in her closet- 18 blue- 32 red and 25 yellow. The lights are out and it is totally dark inspite of the darkness. She can make out the difference between a hat and a glove. She takes out an item out of the closet only if she is sure that if it is a glove. How many gloves must she take out to make sure she has a pair of each colour? a) 50 b) 8 c) 60 d) 42

GHG, Honeywell, Microsoft, TCS, Wipro,

8 General Aptitude 49734

8. Given a collection of points P in the plane , a 1-set is a point in P that can be separated from the rest by a line, .i.e the point lies on one side of the line while the others lie on the other side. The number of 1-sets of P is denoted by n1(P). The minimum value of n1(P) over all configurations P of 5 points in the plane in general position (.i.e no three points in P lie on a line) is a) 3 b) 5 c) 2

TCS,

6 Puzzles 22721




Answers / { sayan bera }

Question { Tech Mahindra, 21651 }

Write code for palindrome?


Answer

Private Sub btnAnswer_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles btnevaluate.Click
Dim Input As String

If IsPalindrome(Input) Then
txtAnswer.Text = "True"
Else
txtAnswer.Text = "False"

End If



End Sub
Function IsPalindrome(ByVal Input As String) As Boolean

Dim Front As Integer
Dim Back As Integer
Dim Middle As Integer
Dim nPalindrome As Boolean

IsPalindrome = False
nPalindrome = True


Back = Input
Middle = Back / 2
Front = 1
If (Back < 1) Then
Exit Function
End If

Do While (Front <> Back And Front <= Middle)
If (Mid(Input, Front, 1) <> Mid(Input, Back, 1)) Then
nPalindrome = False
Exit Do
End If
Back = Back - 1
Front = Front + 1
Loop
IsPalindrome = nPalindrome
Exit Function

End Function
End Class

Is This Answer Correct ?    7 Yes 6 No