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