Help With C Programming Output | Troubleshooting Solutions

  • Thread starter Thread starter chemic_23
  • Start date Start date
  • Tags Tags
    C code Code
Click For Summary
The discussion revolves around a C programming issue where the user is struggling to produce a detailed output for their program. They mention that their current output provides answers but lacks the comprehensive solution format they desire. Suggestions include entering numbers as integers and validating that they fall within the correct range. A key point is the need to break down a two-digit or three-digit number into its individual digits to achieve the desired output. The conversation emphasizes the importance of proper number validation and manipulation to enhance the program's functionality.
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:
 
Technology 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
 
Learn If you want to write code for Python Machine learning, AI Statistics/data analysis Scientific research Web application servers Some microcontrollers JavaScript/Node JS/TypeScript Web sites Web application servers C# Games (Unity) Consumer applications (Windows) Business applications C++ Games (Unreal Engine) Operating systems, device drivers Microcontrollers/embedded systems Consumer applications (Linux) Some more tips: Do not learn C++ (or any other dialect of C) as a...

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
Replies
5
Views
2K
Replies
13
Views
2K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 25 ·
Replies
25
Views
2K
  • · Replies 34 ·
2
Replies
34
Views
5K
  • · Replies 8 ·
Replies
8
Views
4K
  • · Replies 8 ·
Replies
8
Views
2K
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K