<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
<SCRIPT LANGUAGE=vbscript>
<!--
Function IsPrime(str)
str=trim(str) Dim bln,ctr bln=true ctr=1
if(cint(str)<1)then
IsPrime=false exit function end if
if(cint(str)=1 or cint(str)=2 or cint(str)=3)then
IsPrime=true exit function end if
for ctr=cint(str)-1 to 2 step -1 if(cint(str)mod(ctr)=0)then
bln=false end if next
IsPrime=bln
End Function
Function IsEven(str) str=trim(str) if(str="0")then IsEven=true
exit function
end if if(cint(str)mod(2)=0)then IsEven=true
else IsEven=false end if
End Function
Sub mysub()
str=text1.value
if not(isnumeric(str))then msgbox "Not numeric value" exit sub
end if
if(rad(0).checked)then if(IsEven(str))then msgbox "Yes this is even" else
msgbox "No it is not " end if
Exit sub
end if
if(rad(1).checked)then if(IsEven(str))then
msgbox "No it is not odd number"
else
msgbox "Yes it is odd number" end if
Exit sub end if
if(rad(2).checked)then if(IsPrime(str))then
msgbox "Yes it is prime number"
else
msgbox "No it is not a prime number" end if
Exit sub end if
End Sub
//-->
</SCRIPT>
</HEAD>
<BODY>
<P> Even
<INPUT type=radio name="rad" checked value="even"> Odd
<INPUT type=radio name="rad" value="odd"> Prime
<INPUT type=radio name="rad" value="prime">
</P>
<P><INPUT id=text1 name=text1></P>
<P><INPUT id=button1 type=button value=Button name=button1
LANGUAGE=javascript onclick="mysub()"></P>
</BODY>
</HTML>