#include<stdio.h> void main() { int a,b,c,d; printf("Input two numbers for 'greatest common divisor' and 'least common multiple' : "); scanf("%d %d", &a, &b); d=a*b; while(a%b != 0){ c=a%b; a=b; b=c; } printf("The greatest common divisor = %d\nThe least common multiple = %d\n", b, d/b); }
No comments:
Post a Comment