#include<stdio.h>
///Even number series:
int main ()
{
int i,num,sum=0;
printf("Please enter any number:");
scanf("%d",&num);
for(i=2;i<=num;i=i+2)
{
printf("%d ",i);
sum=sum+i;
}
printf("\nThe sum of the even number series is:%d",sum);
return 0;
}
No comments:
Post a Comment