Click here to Skip to main content
15,867,308 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Where is my mistake ?

it should be like for instance user input 4 program show us like that

1.E

2.01

3.0011

4.000111


What I have tried:

How can I write in order with for loop or while loop? - Album on Imgur[^]
Posted
Updated 23-Feb-18 9:40am
Comments
Patrice T 23-Feb-18 15:29pm    
Add your code to question.

Your counter is i, but you're printing the value of a, which never changes.

/ravi
 
Share this answer
 
Comments
lixt1 24-Feb-18 2:26am    
Could you solve my question im stuck here.If i write another printf("%d",i); its not gonna be like that.
Ravi Bhavnani 24-Feb-18 2:29am    
Re-read my solution.

/ravi
When you don't understand why your code is not doing what you expect, it is time to use the debugger and see it perform.

There is a tool that allow you to see what your code is doing, its name is debugger. It is also a great learning tool because it show you reality and you can see which expectation match reality.
When you don't understand what your code is doing or why it does what it does, the answer is debugger.
Use the debugger to see what your code is doing. Just set a breakpoint and see your code performing, the debugger allow you to execute lines 1 by 1 and to inspect variables as it execute.

Debugger - Wikipedia, the free encyclopedia[^]

Mastering Debugging in Visual Studio 2010 - A Beginner's Guide[^]
Basic Debugging with Visual Studio 2010 - YouTube[^]
http://docs.oracle.com/javase/7/docs/technotes/tools/windows/jdb.html[^]
https://www.jetbrains.com/idea/help/debugging-your-first-java-application.html[^]
The debugger is here to show you what your code is doing and your task is to compare with what it should do.
There is no magic in the debugger, it don't find bugs, it just help you to. When the code don't do what is expected, you are close to a bug.
 
Share this answer
 
Comments
lixt1 24-Feb-18 2:25am    
i know whats is debugger.My code is working but not meets question's needs. MR.verywellknower
phil.o 24-Feb-18 9:36am    
You may have to realize that people who answer here actually try to help you. Being rude to them will not help you getting faster or better answers, in fact you may get exactly the contrary, or no answer at all.
The debugger is not only useful when a code is "not working" (despite the fact that "not working" is not informative at all and should be avoided in any issue description). The debugger allows you to inspect a code which compiles and executes without error but yields wrong results. In that sense, your answer to Patrice shows that you actually does not know what really a debugger allows you to do.
So, please, don't be rude to people who actually try to give you meaningful and useful advises; and, please, show your code in your questions. The <pre> tag allows you to easily incorporate code into a question.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900