Shortest code challenge | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Shortest code challenge

what will be the shortest code for the factorial

10th Jan 2018, 7:41 AM
Siraj Ali
Siraj Ali - avatar
5 Answers
+ 2
can be it in a single line
10th Jan 2018, 7:46 AM
Siraj Ali
Siraj Ali - avatar
+ 1
13th Jan 2018, 7:20 AM
VcC
VcC - avatar
- 1
https://code.sololearn.com/cd68VTjfTfkN/?ref=app
10th Jan 2018, 7:44 AM
Jeremy
Jeremy - avatar
- 1
Factorial itself can be in one line. I'll post the code when I figure out how to make cin output directly to function parameter without making a variable.
10th Jan 2018, 8:34 AM
BlazingMagpie
BlazingMagpie - avatar
- 1
https://code.sololearn.com/c3v4kQUBxGBO/?ref=app https://code.sololearn.com/c3SyOGlMgthN/?ref=app I am aware I could stack some lines in main, but it would only hide I couldn't come up with a way to shorten the input. Second one is just with all unnecessary characters removed and one cheeky change to save 1 character.
10th Jan 2018, 8:54 AM
BlazingMagpie
BlazingMagpie - avatar