From d6b8c112b5cd7b6319b83ce0e2f959c193e92d19 Mon Sep 17 00:00:00 2001 From: DeepShikha11 <58968093+DeepShikha11@users.noreply.github.com> Date: Fri, 2 Oct 2020 01:12:44 +0530 Subject: [PATCH] Another approach of finding GCD Just use a Standard template library to make code much easier and beginner-friendly --- InterviewBit/Greatest Common Divisor.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/InterviewBit/Greatest Common Divisor.cpp b/InterviewBit/Greatest Common Divisor.cpp index 7ba8122..0615267 100644 --- a/InterviewBit/Greatest Common Divisor.cpp +++ b/InterviewBit/Greatest Common Divisor.cpp @@ -17,4 +17,7 @@ int Solution::gcd(int a, int b) b %= a; } return b; -} \ No newline at end of file +} +// Another method is just, use a Standard template library to make code much easier +#include +int ans = __gcd(a,b);