Results 1 to 11 of 11
Thread: need help with multiplication
 03062011, 06:46 PM #1Member
 Join Date
 Mar 2011
 Posts
 5
 Rep Power
 0
 03062011, 06:56 PM #2
 Join Date
 Sep 2008
 Location
 Voorschoten, the Netherlands
 Posts
 13,729
 Blog Entries
 7
 Rep Power
 21
 03062011, 07:19 PM #3Member
 Join Date
 Mar 2011
 Posts
 5
 Rep Power
 0
here is my code so far
var y = 1;
var x = 5;
for (y=1; y<11; y = y + 1){
sum = y * x;
document.write("<li>")
document.write ( y + " x " + x + " = " + sum + "<br>");
}
 03062011, 07:22 PM #4
 Join Date
 Sep 2008
 Location
 Voorschoten, the Netherlands
 Posts
 13,729
 Blog Entries
 7
 Rep Power
 21
 03062011, 07:40 PM #5Member
 Join Date
 Mar 2011
 Posts
 5
 Rep Power
 0
I'm having trouble with writing the loop.
Thanks for your help. I will post my question in a javascript forum.
 03062011, 08:05 PM #6
 Join Date
 Sep 2008
 Location
 Voorschoten, the Netherlands
 Posts
 13,729
 Blog Entries
 7
 Rep Power
 21
cenosillicaphobia: the fear for an empty beer glass
 03062011, 09:42 PM #7Member
 Join Date
 Mar 2011
 Posts
 5
 Rep Power
 0
Jos,
Thanks that worked. :)
 03082011, 03:00 AM #8Member
 Join Date
 Mar 2011
 Posts
 5
 Rep Power
 0
Can you help me with this? I know its not javascript. I'm trying to write this code.
function sumThese() {
var sumEven=0, sum5=0;
for(i=0; i<100; i++) {
sumEven = (i % 2 == 0) ? parseInt(sumEven+i) : sumEven ; // if value of i modulus 2 is 0, gets all even numbers
sum5 = (i % 5 == 0) ? parseInt(sum5+i) : sum5 ; // if value of i modulus 5 is 0, gets all multiples of 5
}
alert("sumEven = " + sumEven + ", and sum5 = " + sum5);
}
 03082011, 03:05 AM #9
 Join Date
 Jan 2011
 Location
 Richmond, Virginia
 Posts
 3,069
 Blog Entries
 3
 Rep Power
 8
Please make another thread, don't hijack old solved posts. When/if you make a new thread, please be sure to actually provide a concrete, detailed question.
 03082011, 04:37 AM #10
Actually, it's not a hijack. It's the same OP back with another JavaScript question.
@dakid2: Please find a JavaScript forum, this isn't one.
db
 03082011, 04:41 AM #11
 Join Date
 Jan 2011
 Location
 Richmond, Virginia
 Posts
 3,069
 Blog Entries
 3
 Rep Power
 8
Similar Threads

Multiplication Table
By BillyB in forum New To JavaReplies: 17Last Post: 12242010, 07:58 AM 
need help with this: multiplication table
By MsIceCold in forum New To JavaReplies: 7Last Post: 07132010, 02:31 PM 
Problem regarding multiplication
By javanewbie1234 in forum New To JavaReplies: 1Last Post: 03102010, 10:27 AM 
Help with Multiplication
By phil028 in forum New To JavaReplies: 1Last Post: 12062007, 08:39 PM 
Help with multiplication table
By Albert in forum New To JavaReplies: 1Last Post: 07102007, 05:44 PM
Bookmarks