Correct. What about if n is very large?
QuantumPete
Printable View
any nice free visual C compiler like Miracle C Compiler?
Frankly, for Windows, Visual C++ is the best, but if you found that has a learning curve that you dislike, then any other IDE would have a learning curve that you do not want to overcome. That said, Code::Blocks would be your next best bet.Quote:
any nice free visual C compiler like Miracle C Compiler?
thanks Code::Blocks is excellent
If n is very large, code will run damm slow.
This is not efficient code.
Yes, though there is also a limitation in terms of the range of int.Quote:
If n is very large, code will run damm slow.
This is not efficient code.
To work nothing. It is fine
EDIT: Just for practice, try writing the code using fewer lines. Then try to write the algorithm using more variables instead of recursion