Suppose \(n\) and \(p\) are unsigned int variables in a C program. We wish to…

GATE · 2014 · CS · Set 2 · Computer Science & IT

Suppose nn and pp are unsigned int variables in a C program. We wish to set pp to nC3n_{C_3}. If n is large, which one of the following statements is most likely to set pp correctly?

  1. A.

    p=n∗(n−1)∗(n−2)/6;p = n * (n-1) * (n-2) / 6;

  2. B.

    p=n∗(n−1)/2∗(n−2)/3;p = n * (n-1) / 2 * (n-2) / 3;

  3. C.

    p=n∗(n−1)/3∗(n−2)/2;p = n * (n-1) / 3 * (n-2) / 2;

  4. D.

    p=n∗(n−1)∗(n−2)/6.0;p = n * (n-1) * (n-2) / 6.0;

Attempted by 348 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…