Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package exercises
- object Factoriel extends App {
- def factor(n:Int):Int= {
- if(n==1) 1
- else n* factor(n-1)
- }
- println(factor(5))
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement