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; }