Created
October 5, 2018 17:51
-
-
Save AwlsomeAlex/2277fff4c298daf0c8205bc8ffbec6f6 to your computer and use it in GitHub Desktop.
Factoral Finder
This file contains hidden or 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
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