Email: Password:       Forgot Password 
A Saarsha Group Online Community for dot net codes group like C#, Asp.NET, VB.NET, Sharepoint, JavaScript, JQuery, Ajax, SQL, WCF, WPF.


Viewed:  4235 
Posted On:  23/07/2013 21:50:24 
In this article i am going to tell u about how we can find out the factorial of the number in java 


Below is my code:

import java.util.Scanner;
class factorial
    public static void main(String s[])
    int a,b,c=1;
    System.out.println("enter no. ");
    Scanner scan=new Scanner(;
    System.out.println("you entered"+a);
    System.out.println("factorial "+c);

       Step 1:  After writing this in notepad save the file with the name followed by (.java) for eg. I saved it with
  Step 2 : 
Open command prompt 
  Step 3 : Write javac - Press Enter for compilation

  Step 4 : 
Write java factorial for execution 

Now output:


Image 1.

         HOME   |   Submit Article   |   Contact Us   |   About Us   |   Terms & Condition   |   Advertise With us