Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main () {
- int x,y,z,rem,temp;
- scanf("%d%d",&x,&y);
- temp=x;
- z=y;
- while (z!=0) {
- rem=temp%z;
- temp=z;
- z=rem;
- }
- printf("GCD=%d\n",temp);
- printf("LCD=%d\n",(x*y)/temp);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement