Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7744661
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:49:15+00:00 2026-06-01T09:49:15+00:00

I tried the following challenge: Given the first few factorials: 1! = 1 2!

  • 0

I tried the following challenge:

Given the first few factorials:

1! = 1

2! = 2 x 1 = 2

3! = 3 x 2 x 1 = 6

4! = 4 x 3 x 2 x 1 = 24

What is the sum of the first 15 factorials, NOT INCLUDING 0!?

My solution in Java is the following:

public class Factorial
{
   public static void main(String[] args)
   {
     int sum = 0;    
     int multi = 1;
        for (int i=1;i<=15;i++)         
        {
        multi = multi*i;
        sum = multi+sum;     
        }     
     System.out.print(sum);
   }
}

I verified the solutions for the first 7 factorials but will it work for the first 15?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T09:49:16+00:00Added an answer on June 1, 2026 at 9:49 am

    No, its not working for 15. Use long. Also, you could move the print statement inside the loop, to check from where it starts failing. I guess in this case it’s 13.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I tried following the example given on MSDN , but my code does not
I tried following the answer to this question , but could not get xsd.exe
I tried following codes for adding new contact which is not working in my
Tried following the instructions here: How to use Google app engine with my own
I tried following the instruction s but can't get the plugin to work, the
I tried following the gradle manual with their example like this but copyJars is
I tried following the answer here how to override a task making it depend
I tried following the following example to make an HTTP link in my TextView
I tried following the README file in Ruby 1.9.1 but I can't compile it
I tried following some of the code from here and here , but I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.