forked from mehtimsv/ApLabGitPractice
-
Notifications
You must be signed in to change notification settings - Fork 0
/
1.cpp
59 lines (49 loc) · 993 Bytes
/
1.cpp
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#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()
{
cout<<12<<endl;
long long int b[10];
cout<<13<<endl;
for (int i = 9; i >= 0; i--)
{
b[i] += (int)pow(factorial(10), 2.0) / (i + 1);
}
cout<<14<<endl;
return b;
}
void checkZeros(long long *a)
{
cout<<15<<endl;
for (int i = 9; i >= 0; i--)
{
cout<<16<<endl;
if (a[i] == 0)
cout << "Zero Found" << endl;
}
cout<<17<<endl;
}
int main()
{
cout<<11<<endl;
long long *a;
a = producingTheFactorialFractions();
cout<<"---------"<<endl;
checkZeros(a);
cout<<"+++++++++++++++++++++++++++"<<endl;
for (int i = 0; i < 10; i++)
{
cout << a[i] << endl;
}
cout<<19<<endl;
//delete a;
cout<<"hello";
cout<<"Bye";
}