Logo 
Search:

C Programming Articles

Submit Article
Home » Articles » C Programming » Homework HelpRSS Feeds

Program to calculate the frequency for different values of C starting from 0.01 to 0.1 in steps of 0.01

Posted By: Lorelei Schmidt     Category: C Programming     Views: 3855

For a certain electrical circuit with an industance L and resistance R, the damped natural frequency is given by Frequency = sqrt((1/L*C)-(R*R)/(4*C*C))
It is desired to study the variation of this frequency with C(capacitance). Write aprogram to calculate the frequency for different values of C starting from 0.01 to 0.1 in steps of 0.01.

Code for Program to calculate the frequency for different values of C starting from 0.01 to 0.1 in steps of 0.01 in C Programming

#include <stdio.h>
#include <conio.h>
#include <math.h>

void main()
{
    float L,R,C,frequency;
    clrscr();

    printf("\nEnter industance L:");
    scanf("%f",&L);

    printf("\nEnter resistance R:");
    scanf("%f",&R);

    printf("\nEnter capacitance C:");
    scanf("%f",&C);

    for(C=0.01;C<=0.1;C+=0.01)
    {
        frequency=sqrt((1/(L*C))-((R*R)/(4*C*C)));
        printf("\nFrequency is:%f",frequency);
        printf("\n");
    }
    getch();
}


/*
**********
OUTPUT :
**********

Enter the value of Industance :0.1
Enter the value of Resistance :0.0001

Frequency for c = 0.010000 is 154.622776
Frequency for c = 0.020000 is 22.360680
Frequency for c = 0.030000 is 18.257418
Frequency for c = 0.040000 is 15.811388
Frequency for c = 0.050000 is 14.142136
Frequency for c = 0.060000 is 12.909945
Frequency for c = 0.070000 is 11.952286
Frequency for c = 0.080000 is 11.180340
Frequency for c = 0.090000 is 10.540926
Frequency for c = 0.100000 is 10.000000
*/
  
Share: 



Lorelei Schmidt
Lorelei Schmidt author of Program to calculate the frequency for different values of C starting from 0.01 to 0.1 in steps of 0.01 is from Frankfurt, Germany.
 
View All Articles

Related Articles and Code:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!