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. while(i<=n)
  7. {
  8. s=s+i;
  9. i=i+2;
  10. }
  11. printf("%d",s);
  12. return 0;
  13. }
  14.  
  15.  
Success #stdin #stdout 0s 5320KB
stdin
100
stdout
Enter the value of the last series:2550