-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
40 lines (29 loc) · 890 Bytes
/
main.cpp
File metadata and controls
40 lines (29 loc) · 890 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
29
30
31
32
33
34
35
36
37
38
39
40
#include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;
#include "Header.h"
int main(int nNumberOfArgs,char* pszArgs[])
{
cout << "##########################################"<< endl;
cout << "# This program calculates factorials #"<< endl;
cout << "# of user input #"<< endl;
cout << "# Enter a negative number to exit #"<< endl;
cout << "# by jacksonsr45@gmail.com #"<< endl;
cout << "##########################################"<< endl;
for(;;)
{
int n;
cout << "Enter with a number: ";
cin >> n;
if (n < 0)
{
break;
}
int nFactorial = calcfactorial(n);
cout << "Your number is " << n << " and the factorial is "
<< nFactorial << endl;
}
system("PAUSE");
return 0;
}