Ask your own question, for FREE!
Computer Science 9 Online
OpenStudy (anonymous):

how to write a factorial in C++

OpenStudy (anonymous):

factorial !! explain more plz !!!

OpenStudy (anonymous):

3 factorial = 3! = (3*2*1)

OpenStudy (anonymous):

so say i want \[\frac{ x^3 }{ 3! }\]

OpenStudy (anonymous):

is there an operator for that

OpenStudy (anonymous):

or would i just type it out as (3*2*1)

OpenStudy (anonymous):

I got it , I'll explain the algorithm : we can write a loop like this : for i is from x to 1 then : x! = x * (x-1)

OpenStudy (anonymous):

ok

OpenStudy (anonymous):

how would i write this

OpenStudy (anonymous):

most efficiently

OpenStudy (anonymous):

for example .. to calc 5! : for i= 1 to 5 do x!=x(x-1) is it clear ?

OpenStudy (anonymous):

is that all you would type

OpenStudy (anonymous):

what does i mean

OpenStudy (anonymous):

I'm sorry I'll not write the code to you , I've told you the idea and U've to try ... good luck

OpenStudy (anonymous):

ok thanks

OpenStudy (espex):

@iop360 Try writing the steps out by hand, then look at the process you used and replicate it in your code.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!