fork(3) download
  1. #include <stdio.h>
  2.  
  3. float teste(int c) {
  4. if (c % 2 == 0) {
  5. return 1;
  6. }
  7. return 0;
  8. }
  9.  
  10. int main(void) {
  11. int a = 2, b = 0;
  12. float c;
  13.  
  14. c = a + b;
  15.  
  16. if (a == b || a == c) {
  17. printf("Teste 1 \n");
  18. } else {
  19. printf("Teste 2 \n");
  20. }
  21.  
  22. while (a + 5 >= b) {
  23. c = teste(a + 1);
  24. a = a - c - 1;
  25. printf("%i %f \n", a, c);
  26. }
  27.  
  28. return 0;
  29. }
  30.  
Success #stdin #stdout 0s 4360KB
stdin
Standard input is empty
stdout
Teste 1 
1 0.000000 
-1 1.000000 
-3 1.000000 
-5 1.000000 
-7 1.000000