dpacmittal said:Print the sequence till n number of terms without using any conditions and using just one printf command in whole program. And yeah, no arrays.
Lord Nemesis said:Hmm, First tell me what you mean by not using any conditions. I assume you understand that any statement that translates into a comparion instruction on the CPU counts as a conditional statement. So this includes if else, switch, conditional operator (?, : ) and all loop constructs (while, for, do while) or even any other operation that initiates conditional branching.
If you want to generate only n numbers then there has to be an exit criteria and regardless of the approach you use (looping, function recursion, process recursion i.e forking child processess), it will end up as a comparion operation in the end.
Lol, I can do much more with C now. You bumped old thread man