SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Mar 2003
    Location
    43 03' 16" N :::: 77 36' 03" W
    Posts
    183
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    help with base 2 multiplication table

    i'm new to asp and vb, but my problem is not being able to code something that produces a base2 multiplication table

    we all know what a multiplication table looks like, that goes like 1 2 3 4 5 etc, well i want a "base 2" one that goes like: 2 4 8 16 32 etc.

    here's my code
    Code:
    <table>
    <%
    Dim row col exp outp
    
    exp = 1
    
    for row = 1 to 10
    	response.write "<tr>"
    	
    	for col = 1 to 10
    		outp = 2 * exp
    		response.write "<td>" & outp & "</td>"
    		exp = 2 * exp
    	next
    	
    	exp = row
    	exp = 2 * exp
    	response.write "</tr>"
    next
    %>
    </table>
    Code:
    <table>
    <%
    Dim row col exp outp
    
    exp = 1
    
    for row = 1 to 10
    	response.write "<tr>"
    	
    	for col = 1 to 10
    		outp = 2 * exp
    		response.write "<td>" & outp & "</td>"
    		exp = 2 * exp
    	next
    	
    	exp = 2 * row * row
    	
    	response.write "</tr>"
    next
    %>
    </table>
    note: there are two tables here. neither of them work.

    you can see the results of these @ www.stoneviper.com/asp
    only the first row of each table works, no other rows do what i want them to do.

    please help! thanks
    There's no place like 127.0.0.1

  2. #2
    SitePoint Zealot
    Join Date
    Mar 2003
    Location
    43 03' 16" N :::: 77 36' 03" W
    Posts
    183
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    sorry for the double post. how do i delete the thread?
    There's no place like 127.0.0.1


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •