Thread: help me to write in c programming

  1. #1
    Registered User
    Join Date
    Dec 2014
    Posts
    1

    help me to write in c programming

    Write a program to find the equivalent series and parallel resistance for 3 resistor values. Your program should scan the 3 resistor values and then compute the equivalent series and parallel resistance for all 3 resistors. For example, if the 3 resistor values are r1=100, r2=200 and r3=300 ohms, respectively, their equivalent series resistance is r1 + r2 + r3 = 100 + 200 + 300 = 600 ohms and their equivalent parallel resistance = 1 / [1/r1 + 1/r2 + 1/r3] = 1/[0.01+0.005+0.0033] = 54.55 ohms.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,667
    Read the forum rules.

    You don't get free handouts simply by showing up and posting your assignment.

    You need to show some actual effort.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Dec 2014
    Posts
    8
    you know the solution, it will not be hard for you to write the program!.

  4. #4
    Ultraviolence Connoisseur
    Join Date
    Mar 2004
    Posts
    555
    Sure thing, I'll take $50,000 USD for the job. PM if you're interested

  5. #5
    Registered User
    Join Date
    Oct 2006
    Posts
    3,445
    Quote Originally Posted by nonpuz View Post
    Sure thing, I'll take $50,000 USD for the job. PM if you're interested
    I'll do it for only $25,000USD
    What can this strange device be?
    When I touch it, it gives forth a sound
    It's got wires that vibrate and give music
    What can this thing be that I found?

  6. #6
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    Quote Originally Posted by iraahs View Post
    Write a program to find the equivalent series and parallel resistance for 3 resistor values. Your program should scan the 3 resistor values and then compute the equivalent series and parallel resistance for all 3 resistors. For example, if the 3 resistor values are r1=100, r2=200 and r3=300 ohms, respectively, their equivalent series resistance is r1 + r2 + r3 = 100 + 200 + 300 = 600 ohms and their equivalent parallel resistance = 1 / [1/r1 + 1/r2 + 1/r3] = 1/[0.01+0.005+0.0033] = 54.55 ohms.
    I will give you a hint to avoid C integer division issue in your code.
    Edit: This is a guess on my part that you plan to write actual code.

    Rewrite this
    parallel resistance = 1 / [1/r1 + 1/r2 + 1/r3] = 1/[0.01+0.005+0.0033] = 54.55 ohms.
    as this when doing the C code.
    parallel resistance = 1.0 / [1.0/r1 + 1.0/r2 + 1.0/r3] = 1.0/[0.01+0.005+0.0033] = 54.55 ohms.
    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  7. #7
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    Quote Originally Posted by nonpuz View Post
    Sure thing, I'll take $50,000 USD for the job.
    I wouldn't even get out of bed for that.
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

  8. #8
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    Quote Originally Posted by nonpuz View Post
    Sure thing, I'll take $50,000 USD for the job.
    I wouldn't even get out of bed for that.
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 10-14-2014, 06:35 AM
  2. Replies: 4
    Last Post: 03-09-2014, 08:30 AM
  3. Replies: 3
    Last Post: 10-31-2011, 04:33 AM
  4. Serial Programming, Write-Read Issue
    By a5k3r in forum Linux Programming
    Replies: 1
    Last Post: 07-30-2010, 03:55 PM
  5. read and write image using C programming
    By SHCS in forum C Programming
    Replies: 2
    Last Post: 05-16-2010, 11:03 AM