fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6. int a;
  7. int b;
  8. int i;
  9. int sum=0;
  10.  
  11. scanf ("%d %d %d",&a,&b,&i);
  12. while (i<=a&&a<b&&b<=5000)
  13. {
  14. while (a<b)
  15. {
  16. if (a%2==0)
  17. a++;
  18. sum=sum+a;
  19. a++;
  20.  
  21.  
  22.  
  23. }
  24. printf("The sum of odd numbers from a to b is: %d", sum);
  25. }
  26.  
  27. return 0;
  28. }
Success #stdin #stdout 0s 5436KB
stdin
Standard input is empty
stdout
Standard output is empty