?
?
LiveJournal
Find more
Communities
RSS Reader
Shop
Help
Search
Log in
php_dev
Log in
Join free
Join
English
(en)
English (en)
Русский (ru)
Українська (uk)
Français (fr)
Português (pt)
español (es)
Deutsch (de)
Italiano (it)
Беларуская (be)
php_dev
—
< no suspend reason >
Readability
Find posts by author
Type username to filter posts in this community
Apply
More
php_dev
Archive
Filter by author
Readability
Log in
No account?
Create an account
Remember me
Forgot password
Log in
Log in
Login with Sber ID
QR code
PHP Development's Journal
[Most Recent Entries]
[Calendar View]
[Friends View]
Friday, January 14th, 2005
Time
Event
9:24a
This is a little program that finds the GCF...
try it out!
OR:
Steal the code:
<HTML> <HEAD> <title>Find The GCF By Subtraction</title> </HEAD> <BODY> <?php $var1=$_GET["number1"]; $var2=$_GET["number2"]; if (($var1 > 0) && ($var2 > 0)) { print "Finding gcf for $var1 and $var2 . . ."; $counter = 1; do { $var3=abs($var1 - $var2); $var1=abs($var2 - $var3); $var2=abs($var3 - $var1); $product = $var1*$var2*$var3; } while ($product > 0); print "<br><br><b>gcf:</b>"; if ($var1 >0 ) { print $var1; } else { print $var2; } } ?> <form action="gcf.php" method="GET"> enter two numbers:<br> <input type="text" name="number1"><br> <input type="text" name="number2"><br> <input type="submit" value="find gcf"><br> </form> </BODY> </HTML>
PHP is fun!
(
3 Comments
|
Comment on this
)
<< Previous Day
2005/01/14
[
Calendar
]
Next Day >>
About LiveJournal.com