English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

1-Greatest Common Divisor (GCD
Write an algorithm that calculates the GCD of tow positive integer
PRE-CONDITION.
X, Y are positive and I make use of function MOD(X,Y) which returns the remainder of
The integer division of X by Y
GOAL
To find The Greatest Common Divisor (GCD ) Of X and Y If One or both values
Are 0 then the GCD is considered 0
Post-condition
The function return the value of GCD (x,y)
-AND How to write in c language
2- Counting “THE”
Write an algorithm that counts the number of occurrences of the in a character string that ends with the character “.” You may use the procedures open(),read()
,next(),and close().

PRE-CONDITION.
The input character string is accessible by the procedure read(), which returns the
Current character by the procedure next(), which allows you to read the next character and the procedure open() and close() which enable to start and terminate
The reading of

2006-07-11 18:30:43 · 2 answers · asked by mohamed o 1 in Computers & Internet Programming & Design

2 answers

what i guess you are looking for is euclid's method to find GCD
I will give you the pseudocode
=====================
function gcd(a, b)
if b = 0 return a
else return gcd(b, a mod b)
=====================
Look it up in any math forum and you should see what I mean

2006-07-11 19:35:04 · answer #1 · answered by Neil 5 · 0 0

whaaa..........?????????

2006-07-11 18:33:28 · answer #2 · answered by That Girl 2 · 0 0

fedest.com, questions and answers