Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- #include <iomanip>
- using namespace std;
- float RekvP(float R1, float R2);
- float RekvR(float R1, float R2);
- int main()
- {
- cout << "Program 5 - Ivan Cvijetic IV3" << endl;
- float r1,r2,r3,r4;
- float r12, r124, Re;
- cout << "Unesi vrednosti otpornika" << endl;
- cout << "R1: ";
- cin >> r1;
- cout << "R2: ";
- cin >> r2;
- cout << "R3: ";
- cin >> r3;
- cout << "R4: ";
- cin >> r4;
- r12 = RekvR(r1, r2);
- r124 = RekvP(r12, r4);
- Re = RekvR(r124, r3);
- cout << "Ekvivalentna otpornost je " << Re;
- }
- float RekvP(float R1, float R2){
- return (R1*R2/(R1+R2));
- }
- float RekvR(float R1, float R2){
- return R1+R2;
- }
Add Comment
Please, Sign In to add comment