fork(1) download
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. printf("%f\n", 1/3.0);
  6. printf("%f\n", 2/3.0);
  7. printf("%f\n", 1/3.0 + 2/3.0);
  8. printf("%f\n", 1/3.0 + 1/3.0 + 1/3.0);
  9. if (0.333333 == 1/3.0) {
  10. printf("Entrou\n");
  11. }
  12.  
  13. float soma1 = 0;
  14. for(int i=0; i < 10*3; i++) {
  15. soma1+= 1/3.0;
  16. }
  17. printf("%f \n", soma1);
  18.  
  19. double soma2 = 0;
  20. for(int i=0; i < 10*3; i++) {
  21. soma2+= 1/3.0;
  22. }
  23. printf("%f \n", soma2);
  24. return 0;
  25. }
  26.  
Success #stdin #stdout 0s 5512KB
stdin
Standard input is empty
stdout
0.333333
0.666667
1.000000
1.000000
9.999999 
10.000000