Factorial Program in Java | Using Command argument | Interview Code

//coded by:- aniketkoli183@gmail.com
//for more codes visit here:- http://jerryindia.home.blog

import java.util.*;

class javafactorial
{
	public static void main(String[] args) 
	{
		int no=Integer.parseInt(args[0]);
		int tempo=1;
		for(int i=1;i<=no;i++)
		{
			tempo*=i;
		}
		System.out.println("\nFactorial is:= "+tempo);
	}
}

Leave a comment