+ 2

How to find factorial of 100 ?

c++

10th Mar 2017, 4:38 PM
Imtiaz ali
Imtiaz ali - avatar
9 Respostas
10th Mar 2017, 5:37 PM
Jafca
Jafca - avatar
+ 12
int fact = 1; for loop from x = 1 to x = 100 fact *= x;
10th Mar 2017, 5:25 PM
Jafca
Jafca - avatar
+ 1
no @jafca value cannot be stored in int because it is too long.
10th Mar 2017, 5:28 PM
Imtiaz ali
Imtiaz ali - avatar
+ 1
This might help but results shall be in scientific notation #include <iostream> using namespace std; int main() { double x=100,p=1; while (x>1){ p *= x; x -= 1; } cout<<p; return 0; }
10th Mar 2017, 9:54 PM
देवेंद्र महाजन (Devender)
देवेंद्र महाजन (Devender) - avatar
0
using c++ only!!
10th Mar 2017, 4:50 PM
Imtiaz ali
Imtiaz ali - avatar
0
@moksh makhija
10th Mar 2017, 4:50 PM
Imtiaz ali
Imtiaz ali - avatar
0
#include <iostream> using namespace std; int main() { int sum = 1: int input; cout << "Enter a number: "<<endle; cin >>input ; for (int a=1; a<=input; a++){ sum += a; } cout << sum ; return 0; }
25th Mar 2017, 6:30 AM
Esmatullah Sayeedy
Esmatullah Sayeedy - avatar
0
Enter 100 in input and see... # Using Python https://code.sololearn.com/cM4VQXlTNKYF/?ref=app
17th Nov 2017, 9:40 AM
#RahulVerma
#RahulVerma - avatar