forked from mehtimsv/ApLabGitPractice
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1.cpp
More file actions
29 lines (26 loc) · 712 Bytes
/
1.cpp
File metadata and controls
29 lines (26 loc) · 712 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <iostream>
#include <string>
#include <math.h>
using namespace std;
long long *b;
long long int factorial(int n) {
return (n == 1 || n == 0) ? 1 : factorial(n - 1) * n;}
long long int *producingTheFactorialFractions() {
static long long b[10];
for (int i = 10; i >= 0; i--) {
b[i] = (long long)pow(factorial(10), 2.0) / (i+1); }
return b; }
void checkZeros(long long *a) {
for (int i = 9; i >= 0; i--) {
if (a[i] == 0)
cout << "Zero Found" << endl;
} }
int main() {
long long int *a;
a = producingTheFactorialFractions();
checkZeros(a);
for (int i = 0; i < 10; i++)
{
cout << a[i] << endl; }
a=NULL;
delete a; }