1.

Which of the following gives the sum of the first n natural numbers?(a) nC2(b) (n-1)C2(c) (n+1)C2(d) (n+2)C2I had been asked this question during an internship interview.The above asked question is from Sum of n Natural Numbers using Recursion in division Recursion of Data Structures & Algorithms II

Answer»

Right ANSWER is (C) (n+1)C2

Easiest explanation - The sum of first n natural numbers is GIVEN by n*(n+1)/2, which is equal to (n+1)C2.



Discussion

No Comment Found

Related InterviewSolutions