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 8656207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T15:13:21+00:00 2026-06-12T15:13:21+00:00

I just asked another question about pascal triangle about finding sum of 1500th row.

  • 0

I just asked another question about pascal triangle about finding sum of 1500th row.
I’m so glad that people answered so quickly, But unfortunately later i realized, i need each individual number on 1500th row.

Here i found an easy way to calculate any number on pascal triangle but when i try to use formula in my code, program crashes in start.

#include"stdio.h"
int factorial(int);

int main()
{
    int i=0;
    for(i=0; i<1501; i++)
    {
       printf("%d \n" , (factorial(1500)/factorial(1500-i))/factorial(i) );
    }
}
int factorial(int x)
{
    if(x<2)
    return 1;
    else
    {
        return x*factorial(x-1);
    }
}
  • 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-12T15:13:23+00:00Added an answer on June 12, 2026 at 3:13 pm

    You need a biginteger library for the results, since

    binom(1500,750) = 722462892448930217028116073228485295944376343040546523665632913653613596406381727723198055046187955623124069093412562720869577867557610868874271130828359513282184417776042792372322074253393127328396528996120053749558122610911178218582669317535346728464707661495135518682519172221470420360910320792434869988224466647627642393919250205687942318888922893189087379790541907686956429837978631252775258630376332505697937034877619012586751274240109457111424
    

    exceeds even the usual double range.

    But with such a type available, the relation

    binom(n,k+1) = binom(n,k)*(n-k)/(k+1)
    

    allows a simple, relatively efficient implementation:

    bigint value = 1;
    int numerator = 1500 + 1, denominator = 0;
    for(; denominator <= 1500; --numerator, ++denominator, value = value*numerator/denominator)
    {
        output(value);
    }
    

    where output is whatever output method the library provides.

    The value = value*numerator/denominator part needs to be adapted if the library doesn’t offer overloads for multiplying/dividing bigintegers and normal ints.

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

Sidebar

Related Questions

In another question , I asked something similar but I ended up just posting
Just asked a question about linking Boost libraries in the make file. Thanks to
I've just asked a question about an hour ago, while waiting for replies, I've
I just asked a question about Regex, and received a great answer: JavaScript Split
Another question asked about the meaning of the code snippet a >>> 0 in
Recently, I asked (and answered) a question on StackOverflow about why a unit test
I just asked a question about centering elements, and given what I had to
I asked this morning a question about a jQuery code that's not working (which
I saw that a similar question was asked before, but I don't understand another
I asked another question about HTML and PHP separation as I have seen references

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.