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 />");
  }

Edited 3 Years Ago by pritaeas: Fixed formatting

I'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.

you aren't even trying, anyway unless you show effort i'm not going to monitor this anymore.

well... 2 minutes left...
the test will be over soon...
i'll just fail this one and study for the next one... T_T

Comments
Really pathetic trying to cheat on your test like this.

I 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 that you get punished for your mistakes, thats the only thing that could avoid you from doing such mistakes in the future. Also it's good that no one from here helped you out with those ready-made while loops that you wanted, beacause I'm damn sure that you wouldn't have bothered yourself with them for the rest of your life had you passed this exam.

Not to mention that you failed to explain what is your problem. You just posted some piece of code without saying anything.
Also you were the one that hijacked a 11 month old thread, whithout explaining anything and confusing everybody

@javaAddict : Not that even if he would have detailed his problem to the minunest detail, I would have helped. I would have still left him there to fail misrably.
And yes I mentioned that in the comment where I flagged a post of his as being bad. I also mentioned that he was running helter-skelter everywhere, scattering posts all over.

oh man u still wan them converted?
i wish there was a button called "kick poster who doesnt try to code himself"

May I ask the point of this post ? The OP was made very clear from the first few posts that he wasn't going to get the ready-made help he was looking for, thats the reason he didn't return back. Your posting on this thread unnecessarily keeps it alive and on top.

This article has been dead for over six months. Start a new discussion instead.