filenames and namespace fixes

This commit is contained in:
Krishna Vedala
2020-05-25 23:22:26 -04:00
parent 120fe06fcb
commit 82dab7515c
5 changed files with 10 additions and 11 deletions

View File

@@ -5,7 +5,7 @@ int main() {
int n;
std::cout << "Enter value of n:" << std::endl;
std::cin >> n;
int a[n];
int *a = new int[n];
int i, j, gcd;
std::cout << "Enter the n numbers:" << std::endl;
for (i = 0; i < n; i++) std::cin >> a[i];
@@ -18,5 +18,6 @@ int main() {
gcd = a[j] % gcd; // calculating GCD by division method
}
std::cout << "GCD of entered n numbers:" << gcd;
delete[] a;
return 0;
}