Coding help.

This is a discussion on Coding help. within the C++ Programming forums, part of the General Programming Boards category; I need to code y= (-b + (b^2 4ac)^1/2 )/2a Variables a,b,c,and y are of type float. And for ...

  1. #1
    Registered User
    Join Date
    Feb 2011
    Posts
    5

    Coding help.

    I need to code y= (-b + (b^2 4ac)^1/2 )/2a

    Variables a,b,c,and y are of type float.

    And for this code the square root is exactly the same as it is IRL, like Sqrt 16=4

    Thanks alot

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,725
    So, what have you tried?
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    Feb 2011
    Posts
    5
    idk how to code it, so i haven't tried anything!!

  4. #4
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,725
    Start with showing us how you would write the expression (b^2 – 4ac) as C++ code. If you cannot do that, then you need to re-read your learning material.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  5. #5
    printf("Hello Cboard\n"); codeprada's Avatar
    Join Date
    Jan 2011
    Location
    In a little room at the back of your brain
    Posts
    68
    fairly simple...break it up into parts. like for instance code the parenthesis first then move outwards till you've finished it.
    We shouldn't be quick to criticize unless we can do better.
    Code:
    public function __clone() { die ( "I'm one of a kind" ); }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 9
    Last Post: 03-20-2009, 05:22 PM
  2. Before Coding
    By cyberCLoWn in forum C++ Programming
    Replies: 16
    Last Post: 12-15-2003, 01:26 AM
  3. Coding Contest....
    By Koshare in forum A Brief History of Cprogramming.com
    Replies: 46
    Last Post: 10-14-2001, 04:32 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21