Answers

2015-01-13T13:19:33+05:30

This Is a Certified Answer

×
Certified answers contain reliable, trustworthy information vouched for by a hand-picked team of experts. Brainly has millions of high quality answers, all of them carefully moderated by our most trusted community members, but certified answers are the finest of the finest.
Public class SumOfFactorials {

    public static void main(String[] args) {
        int s = 0;
        for (int i = 1; i<=5; i++){
            int fact = 1;
            int x = 1;
            while (x<=i){
                fact = fact*x;
                x++;
            }
            s = s + fact;
        }
        System.out.println("The sum of the factorials is " + s);
    }

}


1 5 1