Added: 2 years ago
From: Coderisland
Views: 546
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (8)

Sign In or Sign Up now to post a comment!
  • Mine doesnt give the actual addition...

    it always gives the value of the first number then the second number...

    (I.E. 100100 instead of 200)

  • when you declare a var x you gave it the value with double quotes surrounding like this

    x = "100";

    y="100";

    you should do it like this:

    x=100;

    y=100;

    z=x+y;

    if you got any detailed code or more questions visit the forum & post your questions there :)

  • no..

    to be more specific I had a prompt for num1 and a prompt for num2 and then added the num1 and num2.

  • That is why... the prompt is taking the values as strings

  • Is there a way to make the prompt take it as an integer or decimal value?

  • hey man i got an answer for your problem but i can not post source code here, if you posted your problem on the forum it would have bin a lot easier for us, the trick is to use parseInt() function, if you like you can go to coderisland website start a new thread & i will post you a whole code about how to acquire values from prompt box & casting it into integer.

  • Ok, I'll get to that soon

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more