Advertisement
Guest User

Untitled

a guest
Dec 16th, 2019
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. /*
  2. * rezistente.c
  3. *
  4. * Created on: Dec 16, 2019
  5. * Author: cdamian
  6. */
  7.  
  8. #include<stdio.h>
  9. int main(){
  10.  
  11. // declara variabilele
  12. int R1, R2, R3, U;
  13. float I, Re;
  14.  
  15.  
  16.  
  17.  
  18. // citesc datele de intrare
  19. printf("Introduceti valorile celor 3 rez si a tensiunii:");
  20. scanf("%d%d%d%d", &R1, &R2, &R3, &U);
  21.  
  22.  
  23. // calcule
  24. Re = 1 / ( 1.0 / (R1 + R2) + 1 / (float)R3);
  25. I = U / Re;
  26.  
  27.  
  28. // afisare rezultate
  29. printf("Rez echiv este: %f\n", Re);
  30. printf("\nCurenutl prin circuit este: %f", I);
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37. return 0;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement