Hi Gaurav,
I assume you mean different sections of Course A during the same marking period. For example, I might have both a Monday and Tuesday section or a 9 AM and a 1 PM section for the Fall semester.
Option 1: You could assign students to different groups in Course A. The signup would have to be via a survey or forum or something outside Moodle.
Option 2: Create a course for every section. I have done this, I just backup and restore the first course without students and give it a different name. For example, you will have Course A section1, Course B section2. This means you will have to go into each course to grade etc.
Option 3: Create a Course A. Also create individual courses for each of the sections for the students to select. Course A should be a metacourse that gets it's enrollments from the two section courses. Thus students enrolled in a section are automatically enrolled in the metacourse. If you wish, in the metacourse you can assign each section to a different group. Or you can turn off enrollment in a section course while leaving the other section course open.
Hope this gives you some food for thought.
Chris