Samsung Interview Question
Software Engineer / DevelopersCountry: India
Interview Type: Written Test
01. It'll give compile time error given main "}" is not present.
02. If you add "}" at the end then:
(a) it'll give warning for "i" is declared but not used.
(b)for(test();test();test()) {/* do somethibng */}
translates into
for(3;3;3)
i.e. for(initial condition; FALSE; LoopExpression)
it'll print 2 once, as in C++ 0 is TRUE and >0 is FALSE.
It is printing 2 infinite times. I used VC++ 6.0. source file type was C++. May be u need to check ur ans. again
infinite loop
- kedarsdixit April 13, 2013