0

Series and parallel resistance issue*****debug asap

Source Code: #include <iostream> using namespace std; int main() { int arr[100],n; double ser=0,par=0,temp, thres_ser=10, thres_par=10; cout<<"Enter the total number of resistors:\n"; cin>>n; cout<<"Enter the value of each resistor one by one:\n"; for(int i=0;i<n;i++) { cin>>arr[i]; } //to calculate series and parallel for(int i=0;i<n;i++) { ser= ser+ arr[i]; temp= 1/arr[i]; par= par+temp; } par=1/par; cout<<"Series resistance="<<ser<<endl; cout<<”Is is better than Ip”<<endl; cout<<"Parallel resistance="<<par<<endl; if( ser<thres_ser && par<thres_par) { cout<<”Equivalent resistance is less than threshold resistance.”<<endl; } return 0; }

26th Apr 2019, 9:33 AM
Shikher Jaitly
Shikher Jaitly - avatar
3 ответов
+ 2
@ Line 23: cout<<”Is is better than Ip”<<endl; @ Line 27: cout<<”Equivalent resistance is less than threshold resistance.”<<endl; On these two lines, you used specials quotes, the quotes cannot be processed, you need to replace those special quotes with standard quotes. Try it, and let me know how it goes ...
26th Apr 2019, 10:23 AM
Ipang
+ 2
Are you having difficulties in formula implementation in code or is the formula itself was faulty? I'm not studying electronics, but I can try search the formula if that's the case ... If it is the code implementation then maybe you can brief me the formula so I can figure out the implementation ...
26th Apr 2019, 5:33 PM
Ipang
+ 1
Even after changing that... the issue is with the parallel resistance formula
26th Apr 2019, 4:18 PM
Shikher Jaitly
Shikher Jaitly - avatar