#include <stdio.h>
#include "array.h"


int main(){
Stack *stack = NULL;
initStack(stack);
Array *tmp;
int a, b, t, gcd, lcm;
int x = 4;
int y = 18;
a = x;

b = y;

while(b != 0){
t = b;

b = a % b;

a = t;

}
gcd = a;

lcm = x * y / gcd;

printf("Greatest common divisor of %d and %d = %d\n",x,y,gcd);
printf("Least common multiple of %d and %d = %d\n",x,y,lcm);
Array *ptr = NULL;
while (stackEmpty(stack)==0){
stack = popStack(stack, &ptr);
freeArray(ptr);
}
freeStack(stack);
return 0;
}
