when the rod is put near to sphere A a positive charge accumulated on it and a negative charge on sphere B but I am really confused i think that both spheres can be positive so if you have an answer pls help and explain it
Your answer and your explanation are correct. Due to electrostatic induction, A becomes positive and B negative, and when they are separated, the charges are preserved.