 |
By *acktilMan
over a year ago
Tewkesbury |
An there was me thinking no one used:
Fortran Assembly Programming anymore!
* euclid.f (FORTRAN 77)
* Find greatest common divisor using the Euclidean algorithm
PROGRAM EUCLID
PRINT *, 'A?'
READ *, NA
IF (NA.LE.0) THEN
PRINT *, 'A must be a positive integer.'
STOP
END IF
PRINT *, 'B?'
READ *, NB
IF (NB.LE.0) THEN
PRINT *, 'B must be a positive integer.'
STOP
END IF
PRINT *, 'The GCD of', NA, ' and', NB, ' is', NGCD(NA, NB), '.'
STOP
END
FUNCTION NGCD(NA, NB)
IA = NA
IB = NB
1 IF (IB.NE.0) THEN
ITEMP = IA
IA = IB
IB = MOD(ITEMP, IB)
GOTO 1
END IF
NGCD = IA
RETURN
END  |
Reply privately, Reply in forum +quote
or View forums list | |
 |
By *acktilMan
over a year ago
Tewkesbury |
"'scuse my ignorance... but a little enlightenment needed - not sure what fap means? !! "
FAP is American slang for knocking one out, squeezing the sausage, bashing the bishop or any other term used for male masturbation.
As Woody Alan put it sexy with someone you love!
 |
Reply privately, Reply in forum +quote
or View forums list | |
 |
By (user no longer on site)
over a year ago
|
"An there was me thinking no one used:
Fortran Assembly Programming anymore!
"
too old for me - I was a Pl/1 boy!. though turned to the dark side for a fe
w years and switched to Assembler...
I've now recovered! |
Reply privately, Reply in forum +quote
or View forums list | |
 |
By *acktilMan
over a year ago
Tewkesbury |
"my brain hurts.
mine too!
*joins in* "
Ok here it is in a nice modern easy to follow version of the "C" programming language.
#include
int main(void) {
// Define the needed variables.
int divisor, dividend, remainder;
// Prompt the user to enter the two numbers.
printf("Please enter the two numbers whose GCD you would like to find.\n");
printf("Use this format: X, Y\n");
scanf("%i, %i", ÷nd, &divisor);
// Make sure neither is zero.
if(dividend == 0 || divisor == 0) {
printf("Error: Division by 0. I'm afraid I can't do that, Dave.\n");
}
// Make sure neither is one.
if(dividend == 1 || divisor == 1) {
printf("The GCD is 1.\n");
}
// Make sure the dividend is greater than the divisor.
if(divisor dividend) {
remainder = dividend;
dividend = divisor;
divisor = remainder;
}
// Calculate the GCD.
while(remainder != 0) {
remainder = dividend % divisor;
dividend = divisor;
divisor = remainder;
}
// Display the answer to the user.
printf("The GCD is %i.\n", dividend);
}
 |
Reply privately, Reply in forum +quote
or View forums list | |
 |
By (user no longer on site)
over a year ago
|
Ok here is in a nice easy to follow version of the "F" programming language.
#include forplay
intrstg man(hung) {
// Define the need.
intgrte vibrator, end, reminder;
// Prompt the user to enter the two.
plzfk("Please enter the two whose GSPT you would like to find.\n");
plzfk("Use this format: XXXX, Y\Y");
scanties("%i, %i", &disrobe, ÷);
// Make sure neither is zero.
if(disrobe == 0 || divide == 0) {
plzfk("Error: Division by 0. I'm afraid I can't do that, Dave.\n");
}
// Make sure neither is one.
if(disrobe == 1 || divide == 1) {
plzfk("The GSPT is 1.\n");
}
// Make sure the disrober is greater than the dividing.
if(disrobed is dividend) {
remainder = divide;
dividend = divided;
divided = ravished;
}
// Calculate the GSPT lctn.
while(remainder != 0) {
and so on
}
// Display the answer to the user.
plzfk("The GSPT is %i.\n", dividend); |
Reply privately, Reply in forum +quote
or View forums list | |
 |
By (user no longer on site)
over a year ago
|
"Ok here is in a nice easy to follow version of the "F" programming language.
#include forplay
intrstg man(hung) {
// Define the need.
intgrte vibrator, end, reminder;
// Prompt the user to enter the two.
plzfk("Please enter the two whose GSPT you would like to find.\n");
plzfk("Use this format: XXXX, Y\Y");
scanties("%i, %i", &disrobe, ÷);
// Make sure neither is zero.
if(disrobe == 0 || divide == 0) {
plzfk("Error: Division by 0. I'm afraid I can't do that, Dave.\n");
}
// Make sure neither is one.
if(disrobe == 1 || divide == 1) {
plzfk("The GSPT is 1.\n");
}
// Make sure the disrober is greater than the dividing.
if(disrobed is dividend) {
remainder = divide;
dividend = divided;
divided = ravished;
}
// Calculate the GSPT lctn.
while(remainder != 0) {
and so on
}
// Display the answer to the user.
plzfk("The GSPT is %i.\n", dividend); "
 |
Reply privately, Reply in forum +quote
or View forums list | |
 |
By (user no longer on site)
over a year ago
|
"Ok here is in a nice easy to follow version of the "F" programming language.
#include forplay
intrstg man(hung) {
yeah, I know.
// Define the need.
intgrte vibrator, end, reminder;
// Prompt the user to enter the two.
plzfk("Please enter the two whose GSPT you would like to find.\n");
plzfk("Use this format: XXXX, Y\Y");
scanties("%i, %i", &disrobe, ÷);
// Make sure neither is zero.
if(disrobe == 0 || divide == 0) {
plzfk("Error: Division by 0. I'm afraid I can't do that, Dave.\n");
}
// Make sure neither is one.
if(disrobe == 1 || divide == 1) {
plzfk("The GSPT is 1.\n");
}
// Make sure the disrober is greater than the dividing.
if(disrobed is dividend) {
remainder = divide;
dividend = divided;
divided = ravished;
}
// Calculate the GSPT lctn.
while(remainder != 0) {
and so on
}
// Display the answer to the user.
plzfk("The GSPT is %i.\n", dividend);
"  |
Reply privately, Reply in forum +quote
or View forums list | |
 |
By *acktilMan
over a year ago
Tewkesbury |
"Ok here is in a nice easy to follow version of the "F" programming language.
#include forplay
intrstg man(hung) {
// Define the need.
intgrte vibrator, end, reminder;
// Prompt the user to enter the two.
plzfk("Please enter the two whose GSPT you would like to find.\n");
plzfk("Use this format: XXXX, Y\Y");
scanties("%i, %i", &disrobe, ÷);
// Make sure neither is zero.
if(disrobe == 0 || divide == 0) {
plzfk("Error: Division by 0. I'm afraid I can't do that, Dave.\n");
}
// Make sure neither is one.
if(disrobe == 1 || divide == 1) {
plzfk("The GSPT is 1.\n");
}
// Make sure the disrober is greater than the dividing.
if(disrobed is dividend) {
remainder = divide;
dividend = divided;
divided = ravished;
}
// Calculate the GSPT lctn.
while(remainder != 0) {
and so on
}
// Display the answer to the user.
plzfk("The GSPT is %i.\n", dividend); "
Love it. Problem is it wont compile  |
Reply privately, Reply in forum +quote
or View forums list | |
» Add a new message to this topic