Explore BrainMass
Share

Explore BrainMass

    Calculating Power Loss using C Programming Language

    This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

    A program to compute the power loss in a transmission line with a resistance of 0.05 ohms/mile. Compare the power loss if 500 kw of power is transmitted from a power generating station to cities at distances of 20, 30, 40, 50... 100 miles at 100 V and 200 V

    The current I is calculated from

    I = power transmitted in watts divided by volts transmitted
    The total resistance R is computed from the equation:
    Power loss = i² x R.

    © BrainMass Inc. brainmass.com October 10, 2019, 6:21 am ad1c9bdddf
    https://brainmass.com/computer-science/c/calculating-power-loss-c-programming-language-541125

    Solution Preview

    Hi, I include my code as follows and my output after code.

    #include<stdio.h>

    void main()

    {

    double r=0.05;

    int distance;

    double R,i;

    double power=500;

    int v1=100,v2=200;

    //calculating powerloss at v1=100

    printf("nPower loss at 100v");

    for(distance=20;distance <=100;distance=distance+10)

    {

    R=distance*r;

    i=power/v1; ...

    Solution Summary

    The solution gives a complete c language code for calculating the power loss for which the formula is given in the question. The output is also given for reference.

    $2.19