   Simple code extract.. Should this work?
  I was looking at this webpage.http://www.devbistro.com/tech-interview-questions/Cplusplus.jspOn question 3, I am not sure if that code extract does what it says it should.Surely after the first input it will just drop through and end? How would it take more input without looping back round to the cin statement?Can someone confirm this?Mark   
  1° The question does not make sense.2° The code does not make sense.I guess you could say the code answers the question. But you are right in saying that: - It asks for a number - If you enter an incorrect number, it asks for it again, but doesn't let you enter one and displays an average of 0 instead - If you entered a correct number, it displays that number back at you saying that it's the average.By looking at the rest of the page (edit: down to the first "back to top"), it appears to me that it is a bunch of nonsensical ramblings that do not have a lot to do with C++, and are not very useful when preparing for an interview.   ;Quote:Q: Write a short code using C++ to print out all odd number from 1 to 100 using a for loop (Asked by Intacct.com people)for( unsigned int i = 1; i < = 100; i++ )    if( i & 0x00000001 )   cout << i<<\",\";What a strange solution...? I'd do it like this:for (int i=1; i<100; i += 2){    cout << i << endl;};  Im pretty sure that website article has been done on the lunge before and the general consensus was it was tripe.   ;  I thought I was losing it!Thanks.Mark   