Well, you have not stated what you have tried and where was the issue when you tried it.
Have a look at these article on how radio buttons are grouped:
Gropu Radio Button[
^]
How to group RadioButtons[
^]
They are more than enough to understand the logic which can be used for coding your scenario.
UPDATE:
Ok. Fine, try this: (it's in C# that I am writing):
for(int i=0;i<myGroupBox.Controls.Count;i++)
{
RadioButton rb= (RadioButton)myGroupBox.Controls[i];
if(rb.checked==true)
{
}
}