to find the sum of first n even numbers.

No one here will do your homework for you. Please demonstrate that you have at least tried to solve the problem first prior to posting here.

<rant>
Seriously? This is beyond trivial. If you had been paying attention in class at all, or even opened your textbook just once, you could have completed this assignment in less time than it took to post this question. This is laziness of the worst kind, and we at Daniweb aren't going to reward you for it.
</rant>

Sorry for the rant, but I am not kidding - this should take even a rank novice programmer less than five minutes to complete using just paper and pencil. You have wasted both our time and yours by bringing this here.

commented: Well put! Some students can't do the work without looking over the shoulder of better students... +13

Really! Please don't ask us to help you cheat!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.