@ Karan13
obviously n can not be negative therefore ans is 80
This is not the correct answer.
I think you overlooked a critical point in the question stem.
*Q1.The sum of the even numbers between 1 and n is 79*80, where n is an odd number, then n=?*
There is a simple formula for calculating sum of consecutive numbers from 1 to n-->n(n+1)/2 (refer to OG 12 PS 157)
Now since we are calculating in terms even number we need to account for that.
So the formula becomes--> 2n(n+1)/2, which is basically (2s cancel out) = n(n+1)=79*80 hence n=79 & n+1=80. And since n is given as odd, n=79. (in fact, I think it was given explicitly as odd in the question stem in order to avoid any confusion!)
Even by using the formula you have given-->Sn=n/2(2a+(n-1)d)
we could derive 79*80= n/2(2*2(n-1)2)=
79*80=n(n+1) (no need for messy quadratics)
Side note: If you can intuitively understand how this formula is derived and how it makes logical sense, you can gain a deeper understanding and a better grasp instead of blindly apply formulas
http://betterexplained.com/articles/techniques-for-adding-the-numbers-1-to-100/