Created
December 11, 2023 00:39
-
-
Save renatogroffe/59bce2b14f9661164f627bfcfa5fcd4f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace ConsoleAppRefReadOnly; | |
public class Fatorial | |
{ | |
public static int Calcular(ref readonly int numero) | |
{ | |
int resultado = 1; | |
for (int i = numero; i > 1; i--) | |
resultado *= i; | |
return resultado; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment