wap to find a factorial of a number

public class factorial
 {

    public static void main(String[] args) {

        int num = 10;
        long factorial = 1;
        for(int i = 1; i <= num; ++i)
        {
            // factorial = factorial * i;
            factorial *= i;
        }
        System.out.printf("Factorial of %d = %d", num, factorial);
    }
}

Comments

Popular posts from this blog

A story of friendship A tiger and a rat......become a revengable....

best pen drive

wap to perform subtraction