Practical 4
Practical 4
:230843116012
PRACTICAL – 4
AIM:- Implement Euclid algorithm to find GCD.
GCD(16,12) = 4
GCD(12,4) = 0
Then 4 is the GCD(16,12)
CODE:-
#include <stdio.h>
#include <stdlib.h>
if (b == 0) {
printf("%d\n", a);
return;
}
printf("%d\n", a % b);
printGCDSteps(b, a % b);
}
int main() {
int a, b;
return 0;
15
Enrollment No.:230843116012
OUTPUT
16