int main()
{
double X_l=2πfl, X_c=□(1/2πfc), w=2πf;
//Variable Inputs
cout << "Enter the value of X_l=2πfl: ";
cin >> X_l=2πfl;
cout << "Enter the value of X_c=□(1/2πfc): ";
cin >> X_c=□(1/2πfc);
cout << "Enter the value of w=2πf: ";
cin >> w=2πf;
cout << "Enter the value of F: ";
cin >> F;
// calculate the Z
double Z=R*(X_l+X_c )j;
Z = Z_Funct(X_l=2πfl, X_c=□(1/2πfc), w=2πf);
cout << "Z:" << Z;
It looks like things could be simplified. I would expect the user to input three values, Inductance L, Capacitance C and frequency F. (Unless I completely misunderstood what you are trying to do).
So you should do something like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
constdouble PI = 3.1415926535897932385;
double L;
double C;
double F;
cout << "Enter the value of L: ";
cin >> L;
cout << "Enter the value of C: ";
cin >> C;
cout << "Enter the value of F: ";
cin >> F;
After getting the input values, carry out the required calculations and output the result.