@sandeep: so the statement becomes if(ch=0) since printf returns integer 0...whats does this mean now actually?0 is ascii for NULL and so ch is assinged to null? I am slightly confused..
On Tue, Aug 9, 2011 at 7:04 PM, SANDEEP CHUGH <[email protected]>wrote: > @all sorry i give wrong explanation by mistake..:P :P > > printf("") returns no if characters.. in this case returns 0 . which is > assigned to ch > > so in ch 0 is stored and 0 is the ascii value of null character > when we using ch in --- if (ch) --> it will reduce to if(0) -- as 0 is the > ascii value of null character > > so the output "it doesn't matter" > > > On Tue, Aug 9, 2011 at 10:28 PM, Dipankar Patro <[email protected]>wrote: > >> o/p: >> It doesn't matter >> >> Reason: >> printf() returns the number of characters printed to screen. >> since printf("") will return 0, hence the *else* is selected. >> >> >> On 9 August 2011 22:25, siddharth srivastava <[email protected]> wrote: >> >>> >>> >>> On 9 August 2011 22:20, tech rascal <[email protected]> wrote: >>> >>>> #include<stdio.h> >>>> int main() >>>> { >>>> char ch; >>>> if((ch=printf(""))) >>>> printf("it matters"); >>>> else >>>> printf("it doesn't matter"); >>>> return 0; >>>> } >>>> >>>> >>> It doesn't matter >>> >>> >>> >>>> >>>> what will b the output?? >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Algorithm Geeks" group. >>>> To post to this group, send email to [email protected]. >>>> To unsubscribe from this group, send email to >>>> [email protected]. >>>> For more options, visit this group at >>>> http://groups.google.com/group/algogeeks?hl=en. >>>> >>> >>> >>> >>> -- >>> Regards >>> Siddharth Srivastava >>> >>> >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "Algorithm Geeks" group. >>> To post to this group, send email to [email protected]. >>> To unsubscribe from this group, send email to >>> [email protected]. >>> For more options, visit this group at >>> http://groups.google.com/group/algogeeks?hl=en. >>> >> >> >> >> -- >> >> ___________________________________________________________________________________________________________ >> >> Please do not print this e-mail until urgent requirement. Go Green!! >> Save Papers <=> Save Trees >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]. >> 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 [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- "People often say that motivation doesn't last. Well, neither does bathing - that's why we recommend it daily." -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
