From 801a2d9afac2825eb64bae28868dccb2a34b4fb4 Mon Sep 17 00:00:00 2001 From: Shivam Singhal Date: Fri, 2 Jun 2017 11:23:54 +0530 Subject: [PATCH 1/2] Modified it. --- GCD_of_n_numbers.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/GCD_of_n_numbers.cpp b/GCD_of_n_numbers.cpp index 3830a426c..4da29fb6c 100644 --- a/GCD_of_n_numbers.cpp +++ b/GCD_of_n_numbers.cpp @@ -2,6 +2,7 @@ using namepsace std; int main() { + cout <<"Enter value of n:"<> n; int a[n]; int i,j,gcd; From d4d004fe83f143c64f7921023460ffb239bf8b6e Mon Sep 17 00:00:00 2001 From: Shivam Singhal Date: Fri, 2 Jun 2017 11:43:26 +0530 Subject: [PATCH 2/2] Added comments. --- GCD_of_n_numbers.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/GCD_of_n_numbers.cpp b/GCD_of_n_numbers.cpp index 4da29fb6c..3e9e9ce17 100644 --- a/GCD_of_n_numbers.cpp +++ b/GCD_of_n_numbers.cpp @@ -1,3 +1,4 @@ +//This program aims at calculating the GCD of n numbers by division method #include using namepsace std; int main() @@ -6,16 +7,17 @@ int main() cin >> n; int a[n]; int i,j,gcd; + cout << "Enter the n numbers:" << endl; for(i=0;i> a[i]; - j=1; + j=1; //to access all elements of the array starting from 1 gcd=a[0]; while(j