Assume all variable are declared correctly, the following for loop executes how many times?
for (i = 0; i <= 20; i++)
cout << I;
I think 20 but am not sure.
Assume all variable are declared correctly, the following for loop executes how many times?
for (i = 0; i <= 20; i++)
cout << I;
I think 20 but am not sure.
You are incorrect. How many numbers are there, between 0 and 20, inclusive? Remember that you're using <=, and not <.
Also note that in your cout, you're trying to output a variable that has not been declared.
What can this strange device be?
When I touch it, it gives forth a sound
It's got wires that vibrate and give music
What can this thing be that I found?
There was nothing patronizing about that at all.
In fact, I think Elkvis should also told the OP to post code inside code tags and also pointed out that the OP should have made sure his/her code compiled before posting it.
It is really disrespecting to come to a forum and not follow the forum guidelines when posting.
It would have been even better if fb3342 had written a program to test his/her hypothesis of 20, then come here and ask why the result was 21, assuming he/she was unable to figure that out too.Originally Posted by Jimmy
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
My critique was actually not directed towards you. Everybody gets that wrong the first time here. My point was that Elkvis was not patronizing, he was just trying to be helpful.
If you are about to start taking part of technical forums then How To Ask Questions The Smart Way and Short, Self Contained, Correct Example are two good reads which will help you get better help.
I do think you where wrong in one thing. My critique might have been harsh, but it was also very constructive. Doing things right will get you help, doing it wrong will probably not in the long run. If you don't believe me, then you only have to look through the threads and see which post got help and which posts didn't.