diff --git a/1.cpp b/1.cpp index fedde2c..2d3645f 100644 --- a/1.cpp +++ b/1.cpp @@ -13,11 +13,11 @@ long long int factorial(int n) long long int *producingTheFactorialFractions() { - long long b[10]; + b = new long long[10]; - for (int i = 10; i >= 0; i--) + for (int i = 9; i >= 0; i--) { - b[i] += (int)pow(factorial(10), 2.0) / (i + 1); + b[i] += (long long)pow(factorial(10), 2.0) / (i + 1); } return b; } @@ -26,7 +26,7 @@ void checkZeros(long long *a) { for (int i = 9; i >= 0; i--) { - if (a[i] = 0) + if (a[i] == 0) cout << "Zero Found" << endl; } } @@ -43,8 +43,8 @@ int main() } delete a; - cout<<"hello"; - cout<<"Bye"; + cout<<"hello"<