Programming Tutorial (C / Windows/ Prolog)
CLOUD COMPUTING | DATA MINING | ARTIFICIAL INTELLIGENCE | APPLICATION PROGRAMMING IN C/C++/Java
Wednesday, May 4, 2011
PROGRAM TO SEE THE GREATEST COMMON DIVISIOR (GCD)
gcd(A, 0, A).
gcd(A, B, D) :- (A>B),(B>0),R is A mod B,gcd(B,R,D).
gcd(A, B, D) :- (A<B), gcd(B,A,D).
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment