C Program To Find GCD using Pointers and Functions, using Euclid's Algorithm
Satish B
https://technotip.com/8030/c-program-to-find-gcd-using-pointers-and-functions/
Write a function to compute the greatest common divisor given by Euclid's algorithm, exemplified for J = 1980, K = 1617 as follows:
1980 / 1617 = 1 1980 - 1 * 1617 = 363 1617 / 363 = 4 1617 - 4 * 363 = 165 363 / 165 = 2 363 - 2 * 165 = 33 5 / 33 = 5 165 - 5 * 33 = 0
Thus, the greatest common divisor is 33.
Analyze Above Problem Statement
We need to find Greatest Common Divisor(GCD) of 2 numbers entered by the user, using Euclid’s Algorithm.
If J = 1980 and K = 1617, GCD should be 33.
Make sure to use the calculation part as shown in problem statement.
We observe the calculation part in problem statement and formulate some formulas to figure out the result i.e., GCD of 2 numbers input by the user.
C Programming Interview / Viva Q&A List https://technotip.com/6378/c-programming-interview-viva-qa-list/
C Programming: Beginner To Advance To Expert https://technotip.com/6086/c-programming-beginner-to-advance-to-expert/ ... https://www.youtube.com/watch?v=mwDUeKUURbM
17115765 Bytes