division - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

division

Im not clear on division and the remainder %.

Am i suppose to use both the / sign ( to get the main division between two numbers) and then the % sign ( to get the remainder from the answer from the division)in a single division problem to get the remainder?

or else

am i suppose to replace the / sign with the %

this is a little bit confusing?

thank you

Comments

  • DonotaloDonotalo Posts: 715Member
    : Im not clear on division and the remainder %.
    :
    : Am i suppose to use both the / sign ( to get the main division between two numbers) and then the % sign ( to get the remainder from the answer from the division)in a single division problem to get the remainder?
    :
    : or else
    :
    : am i suppose to replace the / sign with the %
    :
    : this is a little bit confusing?
    :
    : thank you
    :
    [purple]
    no, they are seperate operators. if u need the remainder, use only % and when u need division, simply use /.[code]
    int x = 46, y = 13;
    cout << "x%y = " << x%y << endl;
    cout << "x/y = " << x/y << endl;
    [/code]
    see what happens when u run the above code. :-)
    [/purple]
    [hr][purple]~Donotalo()[/purple]

  • zeroscspotzeroscspot Posts: 40Member
    ok, thanks for clearing that up.
Sign In or Register to comment.