Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Factorial

 
Adam Blais
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you compute factorials in java without making a loop for the number?
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could use recursion instead. If you don't know what I mean by this, then google for "recursion" or look it up in the index of your textbook.

Layne
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic