number = 10;
sum = 0;
for (var i=1; i<= number; i++) {
sum = sum + number;
}
document.write("sum = " + sum);
number = 10;
for (var i=number; i > 0; i--) {
if ( i%2 == 1)
document.write(i);
}
product = 1;
number = 5;
for (var i=1; i < (number+1); i++) {
product = product * number;
}
document.write(product);
for ( var i=1; i<= 5; i++) {
for (var j=1; j<=3; j++) {
document.write("*");
}
document.write("<br />");
}
Johannady2
-5
Newbie Poster
Recommended Answers
Jump to Postthis is "JavaScript" and no, try it yourself first.
Jump to PostI'm sure you didn't have 30mins to begin with... If you just understand how a for loop and how a while loop work, it'll take you 1 min to convert.
Jump to Postyou aren't even trying, anyway unless you show effort i'm not going to monitor this anymore.
Jump to PostI am glad that you failed, you were in a test and you weren't knowing such trivial things. I am sure you had been given enough time to learn them, obviously as it appears from your condition, you passed the time, without actually putting it to good use. It's good …
All 13 Replies
sillyboy
43
Practically a Master Poster
Johannady2
-5
Newbie Poster
sillyboy
43
Practically a Master Poster
Johannady2
-5
Newbie Poster
sillyboy
43
Practically a Master Poster
Johannady2
-5
Newbie Poster
Ezzaral
commented:
Really pathetic trying to cheat on your test like this.
-4
verruckt24
438
Posting Shark
sillyboy
43
Practically a Master Poster
javaAddict
900
Nearly a Senior Poster
Team Colleague
Featured Poster
sillyboy
43
Practically a Master Poster
verruckt24
438
Posting Shark
notuserfriendly
1
Junior Poster
verruckt24
438
Posting Shark
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.