Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

I need help on my c code pls

  1. Jan 5, 2010 #1
    apn.png


    my attempt is

    sol.png

    (this is c programming)

    My output is really different. It gives the answer but not a detailed solution as the output above.

    Pls help me I really don't know how to show the long method :frown:
     
  2. jcsd
  3. Jan 5, 2010 #2

    sylas

    User Avatar
    Science Advisor

    There are quite a number of ways to proceed. It is probably easiest to enter numbers as integers, as you are doing. To be really safe, you can also check that each number is in the correct range of values before proceeding.

    Step 1. How could you check that a number is a 2 digit or a 3 digit number?

    In order to do the steps described, you need to break the second number into digits.

    Step 2. If you know you have a two digit number in "y", can you figure out how to get the two digits?

    That will do for a start...

    Cheers -- sylas
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: I need help on my c code pls
  1. Critique my C++ code (Replies: 11)

Loading...