Re: OOT: Interesting C quiz

new topic     » goto parent     » topic index » view thread      » older message » newer message

It says you can only change one character...
either one of the below solutions or changing n=20 to n=21..
But if you change n=20 to n=21 the result will be infinity loop.. ^^

G> It says it can display 21 - signs too, what about n = 21;? :P

G> aku saya wrote:

>>
>>
>>OK,
>>
>>1. change i-- to n--
>>2. change i<n to -i<n
>>3. change i<n to i+n (tricky!)
>>4. change i<n to ~i<n
>>
>>The question says there are at least 4 ways,, who knows there are
>>more...??

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu