for ile yapılmış kod bu;
<script language="vb" runat="server">
sub hesapla(sender as object, e as eventargs)
dim a,b,c,d,i,f,l,k,m as integer
a=s1.text
b=s2.text
c=s3.text
d=1
i=1
f=1
l=1
k=1
m=0
for d=1 to a step 1
l=d*l
next
for i=1 to b step 1
k=i*k
next
for f=1 to c step 1
m=f+m
next
mesaj.text="sonuç: " & l+(k/m)
end sub
</script>
<html>
<body>
<form runat="server">
<table width="243" border="1">
<tr>
<td colspan="2">sayilari girin </td>
</tr>
<tr>
<td width="83">1. sayi </td>
<td width="144"><asp:TextBox ID="s1" runat="server"/></td>
</tr>
<tr>
<td>2.sayi</td>
<td><asp:TextBox ID="s2" runat="server"/></td>
</tr>
<tr>
<td>3.sayi</td>
<td><asp:TextBox ID="s3" runat="server"/></td>
</tr>
<tr>
<td colspan="2"><div align="center"><asp:Button ID="but" Text="hesapla" OnClick="hesapla" runat="server"/></div></td>
</tr>
<tr>
<td colspan="2"><asp:Label ID="mesaj" runat="server"/></td>
</tr>
</table>
</form>
</body>
</html>