fork download
  1. #include<stdio.h>
  2. int main(){
  3. int i=2,s=0,n;
  4. printf("Enter the value of the last series:");
  5. scanf("%d %d",&n);
  6. for(i=2;i<=n;i=i+2)
  7. {
  8. s=s+i;
  9. }
  10. printf("%d",s);
  11. return 0;
  12. }
  13.  
Success #stdin #stdout 0s 5320KB
stdin
100
stdout
Enter the value of the last series:2550