Re: [algogeeks] Re: C aps ques
for 2nd problem: statement inside the do-while is executed once. Now for the condition checking inside the while loop. The condition i++5 is evaluated which turns out to be true. So the rest of the part ++ch='F' is not evaluated and hence letter A is printed six times. Now when the condition i++5 fails, then the condition ++ch='F' would be evaluated which prints BCDEF. This is a property of the logical OR. If the first condition evaluates to true, then rest of the condition is not evaluated as it would always turn out to be true. However, if the first condition is false then only the second condition is checked to get the final output. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: C aps ques
correct me if I am wrong. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: C aps ques
Exactly!! On 12/14/10, RAHUL KUJUR kujurismonu2...@gmail.com wrote: correct me if I am wrong. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: C aps ques
what's the output for following program? #includestdio.h int main() { int i = 0; char ch = 'A'; do{ printf(%c, ch); } while (i++ 5|| ++ch = 'F'); return 0; } (a) ABCDEF (b) AA BCDEF (c) A will be displayed infinitely (d) None of the above On Mon, Dec 13, 2010 at 10:39 PM, siva viknesh sivavikne...@gmail.comwrote: #includestdio.h int main() { int x = 5; printf(%d %d, x++, ++x); return 0; } for this output is 6 7 ... how evaluation proceeds?? -- Regards, $iva -- Regards, $iva -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.