Added some shit
This commit is contained in:
@@ -1,9 +1,22 @@
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
for (int i = 0; i < 10; i++) {
|
||||
cout << i;
|
||||
long factorial(int num) {
|
||||
long factor = num;
|
||||
for (int i = 1; i < num; i++) {
|
||||
factor = i * factor;
|
||||
}
|
||||
return 0;
|
||||
return factor;
|
||||
}
|
||||
|
||||
int main() {
|
||||
int num;
|
||||
cout << "Enter a number to find it's factorial: ";
|
||||
cin >> num;
|
||||
|
||||
long output = factorial(num);
|
||||
cout << output;
|
||||
|
||||
cin >> num;
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user