1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
//Problem #2
double sigma=3, cust,rate, factorial=1, x;
cout<<factorial<<endl;
++factorial //seting to 2
cout<<factorial<<endl;
for(cust=1;cust<=10;cust++)
for(x = cust; x >= 1; x--) {
factorial *= factorial; //multiples with rezult each time
cout<<factorial<<endl;
}
return 0;
}
|
Last edited on
Thanks for the reply!
I just copied this code and the output doesn't match up with what i'm asking o_O. This multiplies numbers like 4*4=16 16*16 = 256 256*256 = ect..
I'm talking about factorials, so its 4! 4*3*2*1 or 6! 6*5*4*3*2*1.
Thank You whitenite... it was a rough draft I was going to make it more organized and readable later.
But ya, not resetting the factorial back to 1 was my issue, doh :(
Hmm ^^...
I wish I could delete my posts, being idiot two times in a row.
Haha don't worry about it, all good :P