Question
In C write a function that computes the Greatest Common Divisor of two long integers: long gcd(long a, long b); Recall that the gcd of
In C write a function that computes the Greatest Common Divisor of two long integers: long gcd(long a, long b); Recall that the gcd of two integers is gcd(a,0) = a gcd(a,b) = gcd(b, a%b) Put this function in a file called gcd.c. This will be a tiny file. Assume that the two integers are zero or positive. The function must be a pure function and must be in its own file. Create a separate source file that contains main for debugging. Compile and run by: C:\Source\>gcc gcdTester.c gcd.c C:\Source\>.\a.exe Enter a: 25 Enter b: 15 The gcd is 5 Include a function prototype (as above) for gcd in the file gcdTester.c
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started