Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Fatorial {
- double result;
- double calculateFatorial(int element) {
- element *= element-1;
- return element;
- }
- public static void main(String[] args) {
- Fatorial fatorial = new Fatorial();
- fatorial.result = 1;
- for (int i = 6; i >= 1; i-=2) {
- fatorial.result *= fatorial.calculateFatorial(i);
- }
- System.out.println("Fatorial : " + fatorial.result);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment