now here's another one-----the program code is extremely elementary, so i'll just remind all d programmers out there, that this is JUST FOR FUN!!!
The question goes like this:::
Code:
int i, n = 20;
for (i=0; i<n; i--)
{
cout << "x" << endl;
}
/* by changing only ONE character in the above code, meaning you cannot change 20 to 31, because you will have changed two characters, you can change 20 to 21, because you only changed the 0, do the following:
find 3 ways to make the above code print x 20 times (by changing only one character). */
See wat i meant,--this is more of a mental ability question, than a programming one.....
Yeah, I remember having fun with same code back in 2nd semester! Even my teacher got fused. He said its fault of DevC++ (on which I was running the code) and that I should use TC++ ROFL
Hi Guest we just wanted to alert you to a major change in the forum. We will no longer be allowing the posting of outgoing links. Please use the attachment feature to attach media to your posts.