Help With C Programming Output | Troubleshooting Solutions

  • Thread starter Thread starter chemic_23
  • Start date Start date
  • Tags Tags
    C code Code
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 2K views
chemic_23
Messages
44
Reaction score
0
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:
 
Physics news on Phys.org
chemic_23 said:
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:

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