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 Prime Factorization calculator


About
  This javascript is used to find the prime factors of a given number and also to find the factors of given number.


Features
a) Used to find the prime factors of the given number.
b) This calculator provides factorization even for large numbers.
c) Provides easy accessibility to calculation.

Preview

Prime Factor Calculator
Enter the number:
Prime factors are:
H



Code
Javascript Code
<!-- Script by hscripts.com -->
<!-- Copyright of HIOXINDIA -->
<!-- More scripts @www.hscripts.com -->
<script type="text/javascript">
function factorise(numm)                      
{
      var newnum = numm;                      
      var newtext = "";
      var chk = 2;                         
      while (chk*chk <= newnum){ 
            if (newnum % chk == 0){
               newtext = newtext + chk;     
               newnum = newnum/chk;          
               if (newnum != 1){
                  newtext = newtext + "*";      
               }
             }
             else{
                chk++;                     
             }
      }
      if (newnum != 1){                                     
           newtext = newtext + newnum;          
      }
      if (newtext == "" + numm){                
          newtext = "Prime Number:"+newtext;      
      }
     document.frm.result.value=newtext;    
}
</script>

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

HTML Code
<table align=center style='border:1px solid green;color: #3D366F;font-size:13px;'>
<form name=frm>
<tr><td>Enter the number:</td><td><input type="text" size="10" name="text1"></td></tr>
<tr><td>Prime factors are:</td><td><input type="text" size="42" name="result"></td></tr>
<tr><td colspan=2 align=center><input type="button" name="button1" value="Prime Factor" onClick="factorise(frm.text1.value)"><a href='http://hscripts.com' style='text-decoration:none;font-size:10;color:green;'>H</a></td></tr>
</form>
</table>

Release Date - 30-07-2009
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 and paste the javascript code into your HTML page and make use of this calculator.
 b) Here,the function "factorise()" provides the prime factorization of the given number.
 c) This script calculates dynamically the factors of any given number.



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