JavaScript Scripts





Español Français 中文 Deutsch Portuguese Japanese nederlands
   
 
Free Java Script Codes
Javascript List All
Slide Show Slide Show
Ad Display Ad Display
Image Effect Image Effect
Animated Image Effects Animated Image Effects
Form Validation Form Validation
Color Picker Tool Color Picker Tool
Formatting Forms Formatting Forms
Select All Select All
Dynamic Form Select Dynamic Form select
Dynamic Color Dynamic Color
Calendar Script Calendar
Textbox Counter Textbox Counter
Alphanumeric Alphanumeric
Date Time Script Date & Time
Stop Watch Script Stop Watch script
Delete Repeated Values Delete Repeated Values
Pagination Pagination
Random Generator Random Generator
Animated Text Animated Text
Cursor Position Cursor Position
User Info Window / User Info
Security Security / Authenticate
Bookmark Bookmark
Mouse Effects Mouse Effects
Title Bar Title Bar
Status Bar Status Bar
Country List Country List
Free Games Free Games
Calculators Calculators
 




Javascript NPR Calculation


About
 Javascript NPR calculator is used to find the number of permutations for the given value. Enter the values to the textbox and find the npr calculations. In probability we can use the permutations.


Features
a) By using this calculator we can find the number of permutations.
b) This is used in probability to calculate permutations.
c) This is free javascript calculator.
d) Copy the code from the given textarea and use it.

Preview

Enter values to the Textbox and then find the permutations.

Enter the value of n
Enter the value of r
The Result
©hscripts.com


Code
Javascript Code
<!-- Script by hscripts.com -->
<!-- Copyright of HIOXINDIA -->
<!-- More script @www.hscripts.com -->
<script type="text/javascript">
function cal()
{
  var n=frm.txt.value;
  var r=frm.txt1.value;
  if(n=="" || r=="")
  {
    alert("Please Enter proper values");
    frm.txt2.value="";
  }
  else
  {
    var f=1;
    for(var i=1;i<=n;i++)
    {
      f=f*i;
    } 
     
    var r1=n-r;
    var res=1;
   
    for(i=1;i<=r1;i++)
    {
     res=res*i;
    }
     var res1=f/res;
     frm.txt2.value=Math.round(res1*Math.pow(10,2))/Math.pow(10,2);
  }
  
} 
function isInteger(s) 
 {
    var i;
    s=s.toString(s);
    for(i=0;i<s.length;i++)
    {
      var c=s.charAt(i);
      if(isNaN(c))
      {
        alert("Given value is not a number");
        frm.txt.value="";
        return false;
      }
   }
    return true;
}
function isInteger1(s)
{
   var i;
   s=s.toString(s);
   for(i=0;i<s.length;i++)
   {
     var c=s.charAt(i);
     if(isNaN(c))
     {
       alert("Given value is not a number");
       frm.txt1.value=""; 
       return false;
    }
   }
   return true;
}
</script>

<!-- Script by hscripts.com -->


HTML Code
<form name="frm"> 
<table style="border:solid green 1px">
<tr><td>Enter the value of n</td>
<td><input type=text name="txt" size=12 onKeyup="isInteger()"></td></tr>
<tr><td>Enter the value of r</td>
<td><input type="text" name="txt1" size=12 onKeyup="isInteger1()"></td></tr>
<tr><td>The Result</td>
<td><input type="text" name="txt2" size=12 READONLY></td></tr>
<tr><td align=right><input type="button" value="Find" onclick="cal()"></td><td></td></tr>
<tr><td></td><td align=center>&copy;<a href="http://www.hscripts.com" style="color:#3D366F;text-decoration:none;cursor:pointer;font-size:13px">hscripts.com</a></td></tr>
</table>
</form>

Release Date - 07-04-2008
Get free version without ©copyright link for just 5 price

For customization of this script or any script development, contact us at support@hscripts.com


Usage
 a) Copy the javascript code into the head part of your HTML page.
 b) Create a HTML form using the above HTML code.
 c) Here,the function "cal()" is used to find out the permutations for the specified values. The functions "isInteger()","isInteger1()" is used to check the given value is string or an integer.
 d) npr calculation is used in probability.
 e) Copy the code into your page and use it.



License
- The javascript (misspelled as java script) is given under GPL License
- i.e. Free use for those who use the codes as it is.
- Free, if your modification does not remove our copyright information and links.
- Click Here for detailed license information.
- You can purchase the script if your requirements does not meet our GPL License terms.
Other Links

web hosting