Re: [algogeeks] Enter in the loop challenge

2012-09-06 Thread Varun
This one's clever! -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/DVlEUy17gMgJ. To post to this group, send email to algogeeks@googlegroups.com. To

Re: [algogeeks] Enter in the loop challenge

2012-09-06 Thread vijay jain
You can put a label in while condition and then use goto label to print hello. #includestdio.h int main() { goto vijay; while ( 0) { vijay: printf(hello); } return 0; } Am i right..please reply.. On Wed, Sep 5, 2012 at 6:15 PM, Shashank Jain

Re: [algogeeks] Enter in the loop challenge

2012-09-06 Thread SHOBHIT GUPTA
also the keywords like int , long etc cannot be included in macro On Wed, Sep 5, 2012 at 7:01 PM, Shashank Jain shashank29j...@gmail.comwrote: thanks that was a really nice explanation shashank On Wed, Sep 5, 2012 at 6:48 PM, Bala cmb...@gmail.com wrote: Source:

Re: [algogeeks] Enter in the loop challenge

2012-09-06 Thread Shashank Jain
@vijay nice thought. but actually the while loop has changed because of addition of label in it. another possible answer could be write a cout hello; statement above the main but the problem given was enter into the loop without changing the loop. On Wed, Sep 5, 2012 at 10:09 PM, SHOBHIT

[algogeeks] Enter in the loop challenge

2012-09-05 Thread Shashank Jain
Here is a question...and i am badly stuck at it how would you get into the loop int main() { while ( 0) { printf(hello); } return 0; } You cannot change the while loop and its condition and you have to print hello -- You received this message because you are

Re: [algogeeks] Enter in the loop challenge

2012-09-05 Thread Bala
#define while(x) while(1) Cheers, -Bala On Wed, Sep 5, 2012 at 7:45 AM, Shashank Jain shashank29j...@gmail.com wrote: Here is a question...and i am badly stuck at it how would you get into the loop int main() { while ( 0) { printf(hello); } return 0; }

Re: [algogeeks] Enter in the loop challenge

2012-09-05 Thread Shashank Jain
it works thanks for your reply On Wed, Sep 5, 2012 at 6:19 PM, Bala cmb...@gmail.com wrote: #define while(x) while(1) Cheers, -Bala On Wed, Sep 5, 2012 at 7:45 AM, Shashank Jain shashank29j...@gmail.com wrote: Here is a question...and i am badly stuck at it how would you get

Re: [algogeeks] Enter in the loop challenge

2012-09-05 Thread Bala
Source: http://gcc.gnu.org/onlinedocs/cpp/Macros.html You may define any valid identifier as a macro, even if it is a C keyword. The preprocessor does not know anything about keywords. This can be useful if you wish to hide a keyword such as const from an older compiler that does not understand

Re: [algogeeks] Enter in the loop challenge

2012-09-05 Thread Shashank Jain
thanks that was a really nice explanation shashank On Wed, Sep 5, 2012 at 6:48 PM, Bala cmb...@gmail.com wrote: Source: http://gcc.gnu.org/onlinedocs/cpp/Macros.html You may define any valid identifier as a macro, even if it is a C keyword. The preprocessor does not know anything about