#include<stdio.h>
void main()
{
int n, sum, i;
printf("Enter value of n");
scanf("%d",&n);
for(i = 1, sum = 2; i <= n; i++)
sum += 2;
printf("Sum of first %d even numbers is = %d",n,sum);
}
Copyright © 2010 C Programs
Icons & Wordpress Theme by N.Design | Blogger Templates by Blog and Web
11 comments: (+add yours?)
wuiiii full program ++
:):):)
Nice blog dude......
Keep it up....
My Email I'd - Jafarbhai_2005@yahoo.com
sum=0 there else the sum will come wrong!
Above Program is Executed.
U r not using clrscr (); for clear the page
so you use clrscr()...
Sir plz help me algirthm to find sum of first n even numbers
Sir plz help me algirthm to find sum of first n even numbers
Sir plz help me algirthm to find sum of first n even numbers
Sorry for late reply.
I have stopped posting programs due to some reason.
Will try to start again posting later on.
Post a Comment