A small object with charge q and weight mg is attached . . .

Question : A small object with charge q and weight mg is attached to one end of a string of length 'L' attached to a stationary support. The system is placed in a uniform horizontal electric field 'E' as shown in the accompanying figure. In the presence of the field, the string makes a constant angle θ with the vertical. The sign and the magnitude of q:
a) positive with magnitude mg/E
b) positive with magnitude (mg/E)tanθ
c) negative with magnitude mg/tanθ
d) positive with magnitude Etanθ/mg

Doubt by Anushka

Ans : b) would be the correct answer. 

Solution : 
The small object is getting attracted in the direction of electric field, hence it must be having negative charge. 

Tsinθ=qE — (1)
Tcosθ=mg — (2)

Dividing eq (1) by (2)

Tsinθ/Tcosθ = qE/mg
sinθ/cosθ = qE/mg
tanθ = qE/mg
(mg/E) tanθ = q

q=(mg/E) tanθ

Hence, b) would be the correct option.