fork(2) download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int i, t1, t2, t13, vet[] = {1,3,5,7,2,4,6,8};
  5. float t3 = 4.5;
  6.  
  7. t1 = (vet[1] + vet[2]) / 2; //4
  8. t2 = vet[0] + vet[7] / 2; //5
  9. //t3 = (vet[0] + vet[7]) / 2.0; //4.5
  10.  
  11. printf("%i %i %i \n", t1, t2, t3);
  12.  
  13. for (i = 1; i <= 6; i++) {
  14. if (vet[i] < t2 && vet[i] <= i) {
  15. printf("%i ", vet[i]);
  16. }
  17. }
  18. return 0;
  19. }
  20.  
Success #stdin #stdout 0s 4560KB
stdin
Standard input is empty
stdout
4 5 0 
2 4