fork download
  1. #include <math.h>
  2. #include <stdio.h>
  3.  
  4. #define PI 3.1415926536
  5. #define TAU (2 * PI)
  6.  
  7. int main(void) {
  8. double step = 1;
  9. double start = 4;
  10. double index;
  11. for (index = 0; index < TAU; index += step) {
  12. double curr = fmod(start + index, TAU);
  13. printf("%d %f\n", (int)curr, curr);
  14. }
  15. puts("");
  16. return 0;
  17. }
Success #stdin #stdout 0.01s 1720KB
stdin
Standard input is empty
stdout
4 4.000000
5 5.000000
6 6.000000
0 0.716815
1 1.716815
2 2.716815
3 3.716815