Código HTML:
<HTML> <BODY> <CENTER> <FORM name="f"> <INPUT type="radio" name="op" onClick="activa1();">Sumar <INPUT type="radio" name="op" onClick="activa2();">Restar <INPUT type="radio" name="op" onClick="activa3();">Multiplicar <INPUT type="radio" name="op" onClick="activa4();">Dividir<br><B>VALORES A OPERAR</B><BR> VALOR A: <INPUT type="text" name="a"><br> VALOR B: <INPUT type="text" name="b"><br> RESPUESTA: <INPUT name="c" type="text"><br> <INPUT type="button" onClick="opera(a.value,b.value,op.value);" value="Calcular"> <INPUT type="reset" value="Nuevo"> </FORM></CENTER> <SCRIPT language="javascript"> function opera(m,n,o) { switch(o) { case 1: f.c.value=parseInt(m)+parseInt(n); break; case 2: f.c.value=parseInt(m)-parseInt(n); break; case 3: f.c.value=parseInt(m)*parseInt(n); break; case 4: f.c.value=parseInt(m)/parseInt(n); break; } } function activa1() { f.op.value=1; } function activa2() { f.op.value=2; } function activa3() { f.op.value=3; } function activa4() { f.op.value=4; } </SCRIPT> </BODY> </HTML>