From f7fd40aad51686e930ea2f59ac12697b62e9f251 Mon Sep 17 00:00:00 2001 From: anm0l555 <54709833+anm0l555@users.noreply.github.com> Date: Tue, 22 Oct 2019 15:10:42 -0400 Subject: [PATCH] factorial.java --- JAVA/factorial.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 JAVA/factorial.java diff --git a/JAVA/factorial.java b/JAVA/factorial.java new file mode 100644 index 0000000..14927f5 --- /dev/null +++ b/JAVA/factorial.java @@ -0,0 +1,14 @@ +import java.util.*; +import java.io.*; +class factorial +{ +public static void main(String args[]) throws IOException{ +{ +Scanner sc=new Scanner(System.in); +int n=sc.nextInt(); +int f=1; +for(int i=1;i<=n;i++) +{ +f=f*i;} +System.out.println("the factorial of the no. "+f); +}}