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