Ask your own question, for FREE!
MIT 6.189 Intro to Programming (Python) 13 Online
OpenStudy (anonymous):

Display the output: Number Factorial 1 1 2 2 3 6 4 24 5 120

TheSmartOne (thesmartone):

Well since it is factorial, then that means: \(\sf Number!= Number \times (number -1) \times ... \times 1\) So for example the factorial of 6 would be \(\sf 6!= 6 \times 5 \times 4 \times 3 \times 2\times 1\)

OpenStudy (anonymous):

can u write the full program 4 me plx in C++

TheSmartOne (thesmartone):

Sorry, I don't know anything about coding/programming or C++ :/

OpenStudy (causticsyndicalist):

Couldn't this go in Computer Science anyway? o_O

TheSmartOne (thesmartone):

Since this is really a dead subject, I would advise you to post your question in the Computer Science subject, as that is more lively.

OpenStudy (causticsyndicalist):

^ Eggscatly

TheSmartOne (thesmartone):

What I was just about to say @CausticSyndicalist xD

TheSmartOne (thesmartone):

Also not to forget, Welcome to OpenStudy! @AmeerHamza

OpenStudy (causticsyndicalist):

xD I swear great minds think alike. =P

OpenStudy (anonymous):

thnk u @TheSmartOne

OpenStudy (anonymous):

hahahaha u both r funny

OpenStudy (causticsyndicalist):

Oh we do try. ;)

TheSmartOne (thesmartone):

Np. Post your question here: http://openstudy.com/study#/groups/Computer%20Science

OpenStudy (anonymous):

#include <iostream> using namespace std; int factorial (int x); int main () { cout<<"Number \tFactorial"<<endl;; int a = 1; int b = 2; int c = 3; int d = 4; int e = 5; ; cout<<a<<"\t"<<factorial(a)<<endl; cout<<b<<"\t"<<factorial(b)<<endl; cout<<c<<"\t"<<factorial(c)<<endl; cout<<d<<"\t"<<factorial(d)<<endl; cout<<e<<"\t"<<factorial(e)<<endl; return 0; } int factorial(int x) { int i; int F=1; for (i = 1; i <= x; i++) F*=i; return F; }

TheSmartOne (thesmartone):

Thank you @data_lg2 :D

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!