Question:
What's wrong with this Java program?
?
2013-01-02 10:22:31 UTC
Sorry i can't post the code because i'm typing through my phone, but my program worked fine with a small set of numbers(5 numbers, 8 numbers). But my program didn't display the correct output for a large set of numbers(16,000 numbers).

What could be wrong?

This program was a coding quiz and they had given sample input and output , so i know the my output is wrong. I have gone through the program logic, but it seems fine to me.

Any help will be appreciated.

Thank you!!! ^_^
Three answers:
anonymous
2013-01-02 11:03:11 UTC
We need to see your code. When you are back on your computer again, post the code so that someone can help you debug it.
Limesticks
2013-01-02 10:28:58 UTC
I have no idea what is wrong, because i have no idea what your code is doing. Post some code and i'll gladly help.



There's one thing i can think of right now by the way. Isn't your program just slow? Have you tried 100 numbers? If so, is your program still fast, or does it take a while to display the output for those numbers? Keep on trying with bigger numbers. You will eventually find that either your program is slow, or there's some other weird bug i don't know about. I can't say much more than this without your code.
sagger
2013-01-02 10:26:27 UTC
It would be easier to identify the problem if you said what your program does?



Some problems that may occur based on what you said:

1) lacking memory?

2) the size of int/float/double etc...

3) bad/size lacking array declaration


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...