```
cout << "Xc = " << Xc;
```

didn't you

```
#include <iostream>
using namespace std;
int main(void)
{
double f;
double C;
double L;
double pi;
double Xl;
double Xc;
cout<<"enter value of frequency";
cin>>f;
cout<<"enter value of L";
cin>>L;
cout<<"enter value of C";
cin>>C;
pi=3.14;
Xl=2*(pi*f*L);
Xc=1/(2*pi*f*C);
cout<<"Xc";
system("pause");
return 0;
}
```

Meroo king292

Comments

```
#include <iostream>
using namespace std;
int main(void)
{
double f=0.0;
double C=0.0;
double L=0.0;
double p=0.0;
double X=0.0;
double Xc=0.0;
double pi=3.14;
cout<<"enter value of frequency"<<endl;
cin>>f;
cout<<"enter value of L"<<endl;
cin>>L;
cout<<"enter value of C"<<endl;
cin>>C;
X=2*(pi*f*L);
Xc=1/(2*pi*f*C);
cout<<"Final Expected Result:"<<Xc;
return 0;
}
```

v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject,
503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada
+1 416-849-8900 x 100

Does it compile?

Does it run?

Does it produce a result?

Is the result correct?

Why are you using such an inacurrate value for pi?

Why are you bothering to calculate Xl and then not using it?