Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- double cons(double R1, double R2) {
- return(R1 + R2);
- }
- double par(double R1, double R2) {
- return ((R1*R2) / (R1 + R2));
- }
- void main(void) {
- cout << "Type down 4 circuit elememts \n";
- double R1, R2, R3, R4;
- cin >> R1 >> R2 >> R3 >> R4;
- cout << "Resistance on 1st ciruit = ";
- cout << cons( cons (cons(R1, R2),R3),R4) << endl;
- cout << "Resistance on 2nd ciruit = ";
- cout << cons(par(R2, R4), R1) << endl;
- cout << "Resistance on 3d ciruit = ";
- cout << cons(cons(R3, par(cons(R2, par(R1,R3)), cons(R1,R4))),R4) << endl;
- _getwch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement