Math calculation of percentage
how to math calculation of percentage? such as: 30 % 4 or 369% 35.
modulo operator means?explain it?
it means division operator. right! thanks jaya and visph
Math percentages and programming operator % aren't related at all... In computer context, x % y means remainder of the integer division of x by y (named 'modulo' in both math and computer fields). In math context, x% of y means x hundredths of y, in other words: value = float(input()) rate = float(input()) percent = value*rate/100 print(str(rate)+'% of',value,'equals',percent)
in js that's the modulo operator ^^
That's already said in my first post...
It's called modular operator.. Gives you reminder of calculation (a%b) in dividend(a) divided by divisor(b). I included already a example in my first post, see it again..
Shadman Sakib Division operator is / returns quotiont. a=30,b=4 document.write(a/b); this prints 7 Modula operator is % returns reminder. document.write(a%b); this prints 2 A slight difference is calling in programming language.
Iyad Ahmed that was not my question.Though thanks for your comment. ☺
thanks all for the help ☺
30% is just 30/100 use that instead when doing calculations then multiply by hundred in the end
Error in Program