Confused...?

Discussion in 'Javascript' started by Linuxmade88, Jan 30, 2020.

  1. Linuxmade88

    Linuxmade88

    Joined:
    Jan 30, 2020
    Messages:
    9
    Likes Received:
    0
    Location:
    Grover Beach
    I am new to coding and am barely in my first week in college learning javascript and im not all that great at math at all so can some one help me understand this and let me know if I did this right?

    question is
    • Find the remainder when 15 is divided by 9, using two variables x and y.
    var x=15;
    undefined
    var y=9;
    undefined
    x/y
    1.6666666666666667

    i'm doing this in the console on firefox, what im confused about is the question is asing to find the remainder and im pretty sure thats definitely not the remainder but i just dont know how to go foreward or even what to do.
     
    Linuxmade88, Jan 30, 2020
    #1
    1. Advertisements

  2. Linuxmade88

    John Joe

    Joined:
    Apr 25, 2017
    Messages:
    137
    Likes Received:
    16
    Location:
    Malaysia
    perhaps you should use % instead of / ?
     
    John Joe, Jan 30, 2020
    #2
    1. Advertisements

  3. Linuxmade88

    Linuxmade88

    Joined:
    Jan 30, 2020
    Messages:
    9
    Likes Received:
    0
    Location:
    Grover Beach
    thank you that was what i needed i appreciate it!
     
    Linuxmade88, Jan 30, 2020
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.