Skip to content

Instantly share code, notes, and snippets.

@AwlsomeAlex
Created October 5, 2018 17:51
Show Gist options
  • Save AwlsomeAlex/2277fff4c298daf0c8205bc8ffbec6f6 to your computer and use it in GitHub Desktop.
Save AwlsomeAlex/2277fff4c298daf0c8205bc8ffbec6f6 to your computer and use it in GitHub Desktop.
Factoral Finder
import java.util.Scanner;
public class factorial {
public static void main(String[] args) {
Scanner n = new Scanner(System.in);
int num, total = 1;
System.out.println("+========================+");
System.out.println("| Factoral Finder - Java |");
System.out.println("+========================+");
System.out.println("Created by Alex Barris");
System.out.println("Source available by Request!");
System.out.println();
System.out.print("Please enter a number: ");
num = n.nextInt();
for(int i=1; i<num+1; i++) {
total=total*i;
}
System.out.println("===========================================");
System.out.println("The factoral value is: "+ total);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment