Gunman July 2, 2004 Share Gunman Member July 2, 2004 that is all Link to comment Share on other sites More sharing options...
Xterminator July 2, 2004 Share Xterminator Member July 2, 2004 yeah well everyone's got their problems.. Link to comment Share on other sites More sharing options...
bullet-401 July 2, 2004 Share bullet-401 Member July 2, 2004 damn canadians... Link to comment Share on other sites More sharing options...
All Kill3r July 2, 2004 Share All Kill3r Member July 2, 2004 corn's such a waste of time to eat... you don't actually get anything from it. it comes out still corn. Link to comment Share on other sites More sharing options...
Mok July 2, 2004 Share Mok Member July 2, 2004 damn canadians... Link to comment Share on other sites More sharing options...
gOOters July 2, 2004 Share gOOters Member July 2, 2004 corn poo makes me smile Link to comment Share on other sites More sharing options...
rackish July 2, 2004 Share rackish Member July 2, 2004 (edited) post count++ Edited July 2, 2004 by rackish Link to comment Share on other sites More sharing options...
KagE July 2, 2004 Share KagE Member July 2, 2004 I eat corn too Link to comment Share on other sites More sharing options...
Jiffy July 3, 2004 Share Jiffy Member July 3, 2004 rofl rofl rofl @ killer. Link to comment Share on other sites More sharing options...
Hitman July 3, 2004 Share Hitman Member July 3, 2004 post count++ invalid variable name Link to comment Share on other sites More sharing options...
Xterminator July 3, 2004 Share Xterminator Member July 3, 2004 post count not defined. Link to comment Share on other sites More sharing options...
NOFX July 16, 2004 Share NOFX Member July 16, 2004 (edited) int x=0; int i; while (x >=10, x++); { i = i+x; } print i; heh first one to type the output gets a cookie. Edited July 16, 2004 by NOFX Link to comment Share on other sites More sharing options...
dwEEziL July 16, 2004 Share dwEEziL Member July 16, 2004 i=11 Link to comment Share on other sites More sharing options...
bullet-401 July 16, 2004 Share bullet-401 Member July 16, 2004 Error, since "i" is not set a number. Link to comment Share on other sites More sharing options...
NOFX July 16, 2004 Share NOFX Member July 16, 2004 Error, since "i" is not set a number. well you dont have to declare int's in all languages but lets assume its null to begin with. I dont think its 11. Link to comment Share on other sites More sharing options...
bullet-401 July 16, 2004 Share bullet-401 Member July 16, 2004 Error, since "i" is not set a number. well you dont have to declare int's in all languages but lets assume its null to begin with. I dont think its 11. Then the output is NULL It can't even begin the loop since X is not >= 10 Link to comment Share on other sites More sharing options...
NOFX July 16, 2004 Share NOFX Member July 16, 2004 lol good point how about while (x <=10, x++); { i = i+x; } print i; thats what i meant to do Link to comment Share on other sites More sharing options...
bullet-401 July 16, 2004 Share bullet-401 Member July 16, 2004 55 int y,x; int n=0; for (x=0;x<=10;x++){ for (y=10;y>0;y--){ x++; if ((x>5)&&(y>1)) n++; } } What is n? Link to comment Share on other sites More sharing options...
NOFX July 16, 2004 Share NOFX Member July 16, 2004 lol ding ding ding, we need to start a thread like whos line is it anyway, except with snippets of code, the person who gets the answer gets to post the next. Link to comment Share on other sites More sharing options...
PHYZER23 July 16, 2004 Share PHYZER23 Member July 16, 2004 beep beep beep!!!!! its my nerd-dar going krazy Link to comment Share on other sites More sharing options...
dwEEziL July 16, 2004 Share dwEEziL Member July 16, 2004 So explain your code NOFX. I don't understand what the "x++" stands for. Might help, although not really needed I suppose, what language it is. Link to comment Share on other sites More sharing options...
bullet-401 July 16, 2004 Share bullet-401 Member July 16, 2004 x++ x+=x x=x+1 all the same. Not sure about the middle one I have. Might be different. Link to comment Share on other sites More sharing options...
dwEEziL July 16, 2004 Share dwEEziL Member July 16, 2004 So how did you get 55 then? I thought I read it as, while x is less than or equal to 10, x++ (or add one to x). That is how I came up with 11. Remember though, I am a code n00b. Just did some random scripts here or there and none in C++. Link to comment Share on other sites More sharing options...
NOFX July 16, 2004 Share NOFX Member July 16, 2004 well you set i = to 0, and you increment x each time it does the loop. Inside the loop you add i + x = i; the first number is i and the second is x. so heres each step of the loop 0+0=0 0+1=1 1+2=3 3+3 =6 6+4=10 10+5=15 15+6=21 21+7=28 28+8=36 36+9=45 45+10 = 55 x is then bumped to 11, which is greater than 10. So you fall out of the loop and print i. i is then = to 55 Link to comment Share on other sites More sharing options...
NOFX July 16, 2004 Share NOFX Member July 16, 2004 (edited) int y,x;int n=0; for (x=0;x<=10;x++){ for (y=10;y>0;y--){ x++; if ((x>5)&&(y>1)) n++; } } What is n? you hit the first for loop and its passes and you go to the next loop. It will do the next loop and when it falls out of the inside loop, you will have y=1, x=9 and n=3. Then we go back to the first for loop again since x is incremented it will =10. Passes the loop and does the inside loop again. This time the if statement will always fail because x will always be greater than 5, so N will stay the same. hits the first loop again and fails because x will be something like 19? So N=3 and the top loop is useless? Edited July 16, 2004 by NOFX Link to comment Share on other sites More sharing options...
Recommended Posts