C++ program – Sum of n even Nos

by Nideesh C on April 29, 2011 · 0 comments

in C++




#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int i,s=0;
for(i=2;i<=100;i=i+2)
{
s=s+i;
cout<<"+"<<i;
}
cout<<"="<<s;
getch();
} 



Not Satisfied ? Just search & get the result

Related Posts Plugin for WordPress, Blogger...
Be Sociable, Share!

Related posts:

  1. Sample – Program to find the sum of each row & column of a matrix of size n x m and if matrix is square, find the sum of the diagonals also..
  2. C++ program – Implementation of class
  3. Sample – Program to find the sum of either of the diagonals of a 4 x 4 matrix.
  4. Sample – Program to enter a sentence and output the number of uppercase & lowercase consonants, uppercase & lowercase vowels in sentence..
  5. C++ program – Swap two variables using function overloading

Leave a Comment

Previous post:

Next post: