Imagem de fundo

Considere o seguinte método fatorial implementado em...

Considere o seguinte método fatorial implementado em Java.


public static int fatorial( int n ){

return n > 1 ? n*fatorial( n -1 ): 1; }


Quais resultados esse método fatorial retornará para os seguintes valores de n: 0, 1,2, 3, 4 e 5, respectivamente?


A

0,1 ,2 , 3,4 e 5


B

1, 1, 2, 6, 24 ,120


C

1 ,1 ,1 ,1 ,1 e 1


D

0 ,1 ,2 ,6 ,2 4 ,120


E

-1 ,0 ,2 ,6 ,1 2 ,2 0