fork download
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. void test(float a, float b, float c) {
  5. int n = round((c-a) / (b-a));
  6. for (int i=0; i<=n; i++) {
  7. printf("%g ", i*(b-a)+a);
  8. }
  9. printf("\n");
  10. }
  11.  
  12. void test(float a, float c) {
  13. test(a, a+1, c);
  14. }
  15.  
  16. int main() {
  17. test(26.0, 26.2, 27.0);
  18. test(25.5, 30.0);
  19. test(25.0, 27.0, 32.0);
  20. return 0;
  21. }
Success #stdin #stdout 0.01s 2680KB
stdin
Standard input is empty
stdout
26 26.2 26.4 26.6 26.8 27 
25.5 26.5 27.5 28.5 29.5 30.5 
25 27 29 31 33