Thursday, July 30, 2009

C++ Loop structure Question / Return Value Question?

If you can only keep one of them (and still be able to write any kind of repetitions), which one would you keep? Why?





a The while loop because the other two structures can be easily converted into a while loop.


b The for loop because it is the simplest and the most straight forward.


c The do .. while loop because it is suitable for making a menu.


d You have to use all three for different looping tasks.





At most how many values can a function return through its name?





a None.


b 1


c 2


d Any number. It's up to the programmer

C++ Loop structure Question / Return Value Question?
imho


d





as a fact


b
Reply:1. b (the for loop is the most efficient looping structure, besides you can generate any kind of loops using it)





2. d (you can return arrays and structures/classes in C++, so it's up to the programmer)





Thanks.


No comments:

Post a Comment