K
Kenneth Brody
Suman said:Vladimir said:[... snip code with rewritten main() ...]Suman said:Vladimir Oka wrote:
Piyush Agarwal wrote:
[ snip code with UB ]
What value can be given to x such that the output is "Hello
World"?
I think you misrepresented the trick question.
With `x` an `int` it will never work.
I don't think you were allowed to change the `if` statement. Have a
look at my other post as well.
Show me where this constraint was mentioned
The original post said:
What value can be given to x such that the output is "Hello World"?
All you're allowed to do is give x a value.
If you're allowed to modify the code, why not just:
#include <stdio.h>
int main(void)
{
printf("Hello World\n");
}
[...]
--
+-------------------------+--------------------+-----------------------------+
| Kenneth J. Brody | www.hvcomputer.com | |
| kenbrody/at\spamcop.net | www.fptech.com | #include <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------------+
Don't e-mail me at: <mailto:[email protected]>