Hey guys, I came across another great question. Hope you guys too enjoy solving it and learn something new. Sโ€ฆ

ravikaranrathore

Hey guys, I came across another great question.
Hope you guys too enjoy solving it and learn something new.

Suppose n and p are unsigned int variables in a C program. We wish to set p to ๐‘› ๐ถ 3โ€‹. If n is large, which one of the following statements is most likely to set p correctly?

A. p = n *(n-1) *(n-2) / 6;

B. p = n * (n-1) / 2 * (n-2) / 3;

C. p = n* (n-1) / 3 *(n-2) / 2;

D. p = n * (n-1) *(n-2) / 6.0;

Comments

  • Ravikaran Singh

    For solution and explination refer: https://www.geeksforgeeks.org/questions/suppose-n-and-p-are-unsigned-int-variables-in/