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
Copyright © 2024 1QUIZZ.COM - All rights reserved.
Answers & Comments
Verified answer
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
whaaa..........?????????