ANA SAYFA | FORUM | BLOG | SİTENİZ İÇİN | İÇERİK EKLE | EN YENİLER | EN POPÜLERLER | EN BEĞENİLENLER | REKLAM | İLETİŞİM
Arama:
Tüm kategorilerde Google Forumda JAVAScript Araçlar
// ÖZELLEŞTİR
E-posta:
Şifre:
Üye Ol
|
Şifremi Unuttum
>> PHP Arşivimiz Gelişiyor! (0 yorum)>> ARŞİVİMİZ FORUM AÇILDI! (0 yorum)>> Ramazan Bayramınız kutlu olsun (2 yorum)>> Kurban Bayramı (0 yorum)>> 10 Kasım (1 yorum)
// EN YENİLER
// EN POPÜLER
// Anasayfa » JAVASCRIPT» Hesap makinaları
Oy:
<!-- TWO STEPS TO INSTALL GCD/LCM CALCULATOR: 1. Copy the coding into the HEAD of your HTML document 2. Add the last code into the BODY of your HTML document --> <!-- STEP ONE: Paste this code into the HEAD of your HTML document --> <HEAD> <script type="text/javascript"> <!-- This script and many more are available free online at --> <!-- The JavaScript Source!! http://javascript.internet.com --> <!-- Original: Seamus Yim --> <!-- Begin function go(input1,input2,input3){ if (document.form1.text3.value!=""){ document.form1.answer.value=hcf(hcf(input1,input2),input3); document.form1.answer2.value=lcm(lcm(input1,input2),input3); } else { document.form1.answer.value=hcf(input1,input2); document.form1.answer2.value=lcm(input1,input2); } } function hcf(text1,text2){ var gcd=1; if (text1>text2) {text1=text1+text2; text2=text1-text2; text1=text1-text2;} if ((text2==(Math.round(text2/text1))*text1)) {gcd=text1}else { for (var i = Math.round(text1/2) ; i > 1; i=i-1) { if ((text1==(Math.round(text1/i))*i)) if ((text2==(Math.round(text2/i))*i)) {gcd=i; i=-1;} } } return gcd; } function lcm(t1,t2){ var cm=1; var f=hcf(t1,t2); cm=t1*t2/f; return cm; } // End --> </script> </HEAD> <!-- STEP TWO: Copy this code into the BODY of your HTML document --> <BODY> <div align="center"> <form name="form1"> First Number: <input type="text" name="text1" size="3"> Second Number: <input type="text" name="text2" size="3"><br> Third Number (<em>not required</em>): <input type="text" name="text3" size="3"> <br><br> <input type="button" value="Find GCF and LCM" onclick="go(eval(document.form1.text1.value),eval(document.form1.text2.value),eval(document.form1.text3.value))"> <br><br> Greatest Common Factor (GCF): <input type="text" name="answer" size="3" readonly> <br> Least Common Multiplier (LCM): <input type="text" name="answer2" size="3" readonly> </form> </div> <p><center> <font face="arial, helvetica" size"-2">Free JavaScripts provided<br> by <a href="http://javascriptsource.com">The JavaScript Source</a></font> </center><p> <!-- Script Size: 2.25 KB -->
Kodu Kopyala
Hata Bildir | Tavsiye Et
Bu içeriğe oy verin:
Yorumlar / Yeni Yorum Yaz Bu içeriğe yorum yazılmamış.
ANA SAYFA | İÇERİK EKLE | YENİ EKLENENLER | EN POPÜLERLER | EN BEĞENİLENLER | REKLAM | DESTEKLEYENLER | İLETİŞİM
JAVAScript İndir © 2004 - 2008Web Tasarımı: Emir Emiroğlu | Kodlama: Can "FiNaRFiN" HANHAN , Korkut TAHAOĞLU, Göktuğ İÇÖZ