0

can someone help me for this cuz I dont know what to do

#include<stdio.h>
#include<math.h>
/**RLC Circuit**/
void main()
{
 float v, r, l, c, f, i;
 long double Xc, Xl, Z, Vr, Vc, Vl;
 const double pi=3.1415926535;

 printf("Enter v=");
 scanf("%d",&v);
  printf("Enter r=");
 scanf("%d",&r);
  printf("Enter l=");
 scanf("%d",&l);
  printf("Enter c=");
 scanf("%d",&c);
  printf("Enter f=");
 scanf("%d",&f);

 Xc=(1/(2*pi*f*c));

 Xl=2*pi*f*l;

 Z=(sqrt(pow(2,r)+pow(2,abs(Xl-Xc))))*(-atan2((abs(Xl-Xc)),r));
  printf(" Z =%d\n ",Z);

 i=v/Z;

 Vr=i*r;
  printf("Vr=%d\n ",Vr);
 Vc=i*Xc;
  printf("Vc=%d\n ",Vc);
 Vl=i*Xl;
  printf("Vl=%d\n ",Vl);
}
2
Contributors
1
Reply
3
Views
8 Years
Discussion Span
Last Post by Creator07
0

can someone help me for this cuz I dont know what to do

#include<stdio.h>
#include<math.h>
/**RLC Circuit**/
void main()
{
float v, r, l, c, f, i;
long double Xc, Xl, Z, Vr, Vc, Vl;
const double pi=3.1415926535;

printf("Enter v=");
scanf("%d",&v);
printf("Enter r=");
scanf("%d",&r);
printf("Enter l=");
scanf("%d",&l);
printf("Enter c=");
scanf("%d",&c);
printf("Enter f=");
scanf("%d",&f);

Xc=(1/(2*pi*f*c));

Xl=2*pi*f*l;

Z=(sqrt(pow(2,r)+pow(2,abs(Xl-Xc))))*(-atan2((abs(Xl-Xc)),r));
printf(" Z =%d\n ",Z);

i=v/Z;

Vr=i*r;
printf("Vr=%d\n ",Vr);
Vc=i*Xc;
printf("Vc=%d\n ",Vc);
Vl=i*Xl;
printf("Vl=%d\n ",Vl);
}

What do you exactly want? This is a simple program which finds the potential diff. between all the components of the LCR ckt.

Please specify your question, and code you progs.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.