Bad in math! I don't know how to Calculate the percentage?

A

Anonymous

Guest
I want to Calculate the percentage of two numbers
For example:

25 out of 50 = 50 %

15 out of 35 = # % ??????????????????????????


I don't know how to calculate using math symbols :?
If I know that ...

Than I have to make it ih php coding 8)

Can anyone help :(
 
Code:
<?php

$val = 25;
$total = 50;

printf('%d%%', ($val / $total) * 100); 
// Output: 50%

?>
It should work.
 
Back
Top