package array;
import java.util.Scanner;
public class Fact {
public static void main(String[] args) {
int i,n,f=1;
Scanner sc=new Scanner(System.in);
System.out.println("Enter the number");
n=sc.nextInt();
for(i=1;i<=n;i++)
{
f=f*i;
}
System.out.println("Factorial is");
System.out.println(f);
}
}
import java.util.Scanner;
public class Fact {
public static void main(String[] args) {
int i,n,f=1;
Scanner sc=new Scanner(System.in);
System.out.println("Enter the number");
n=sc.nextInt();
for(i=1;i<=n;i++)
{
f=f*i;
}
System.out.println("Factorial is");
System.out.println(f);
}
}
Wow! It was the best article , actually you have posted something useful than others, because I read many articles related to this basics of programming, but I only get impressed with your post only, keep posting.
ReplyDeleteRegards,
Python Training in Chennai|Python Training|Python Training Institutes in Chennai