I think by defining equivalnces also we can print miracle for ex -1%2 and 1%2 are same and 1%2!=0 odd%2 and -odd%2 are same and odd!=0 but -1%2 is giving -1 . but don't know how to make it 1. help someone if possible.
On Mon, Aug 30, 2010 at 12:40 AM, srinivas reddy <[email protected]>wrote: > @aravind thanks yarr > E.srinivas > m.c.a nit durgapur > > > On Mon, Aug 30, 2010 at 12:34 AM, Aravind <[email protected]>wrote: > >> @srinivas ok it prints miracle...... this is hw the code will look after >> macro substitution... >> if (1 || 1 == -1 || 1 && 1 || 1 != 0) >> >> On Mon, Aug 30, 2010 at 12:18 AM, srinivas reddy < >> [email protected]> wrote: >> >>> @aravind no aravind it's working plz run my code and check it >>> >>> >>> On Mon, Aug 30, 2010 at 12:12 AM, Aravind >>> <[email protected]>wrote: >>> >>>> @srinivas i think miracle will not be printed....as n||n is n , so m==p >>>> is n == -n and this is not possible..... >>>> >>>> >>>> On Mon, Aug 30, 2010 at 12:00 AM, srinivas reddy < >>>> [email protected]> wrote: >>>> >>>>> @ aravind i wrote the code without macro isn't right plz check it.. >>>>> >>>>> >>>>> On Sun, Aug 29, 2010 at 11:56 PM, Aravind <[email protected] >>>>> > wrote: >>>>> >>>>>> @srinivas the macro will replace the 'data' with 1 || 1 and this will >>>>>> make the if condition true and print miracle. >>>>>> >>>>>> >>>>>> On Sun, Aug 29, 2010 at 11:24 PM, srinivas reddy < >>>>>> [email protected]> wrote: >>>>>> >>>>>>> @aravind this is slight modification to your one and this is >>>>>>> generalized one if it is not the way plz inform me >>>>>>> >>>>>>> #include<stdio.h> >>>>>>> void main() >>>>>>> { >>>>>>> int m,n,p; >>>>>>> printf("enter data"); >>>>>>> scanf("%d",&n); >>>>>>> m=n||n; >>>>>>> p=-n||-n; >>>>>>> if(m==p && n!=0) >>>>>>> printf("miracle"); >>>>>>> } >>>>>>> >>>>>>> here i replace data with m and -data with n so the code is working >>>>>>> properlyy i think >>>>>>> >>>>>>> >>>>>>> >>>>>>> On Sun, Aug 29, 2010 at 11:04 PM, srinivas reddy < >>>>>>> [email protected]> wrote: >>>>>>> >>>>>>>> @aravind i think u are right code plzz >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> On Sun, Aug 29, 2010 at 10:59 PM, Aravind < >>>>>>>> [email protected]> wrote: >>>>>>>> >>>>>>>>> #define int 1 || >>>>>>>>> #define data 1 || 1 >>>>>>>>> >>>>>>>>> having theses macros will print miracle.... >>>>>>>>> if macros are allowed.... >>>>>>>>> >>>>>>>>> On Sun, Aug 29, 2010 at 10:20 PM, Manjunath Manohar < >>>>>>>>> [email protected]> wrote: >>>>>>>>> >>>>>>>>>> it will never print..and @ above..the != will never be evaluated >>>>>>>>>> ..because of the short circuiting && >>>>>>>>>> >>>>>>>>>> -- >>>>>>>>>> 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]<algogeeks%[email protected]> >>>>>>>>>> . >>>>>>>>>> For more options, visit this group at >>>>>>>>>> http://groups.google.com/group/algogeeks?hl=en. >>>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> -- >>>>>>>>> The Power to Believe in yourself, will become the power to change >>>>>>>>> Fate. >>>>>>>>> >>>>>>>>> -- >>>>>>>>> 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]<algogeeks%[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]<algogeeks%[email protected]> >>>>>>> . >>>>>>> For more options, visit this group at >>>>>>> http://groups.google.com/group/algogeeks?hl=en. >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> The Power to Believe in yourself, will become the power to change >>>>>> Fate. >>>>>> >>>>>> -- >>>>>> 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]<algogeeks%[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]<algogeeks%[email protected]> >>>>> . >>>>> For more options, visit this group at >>>>> http://groups.google.com/group/algogeeks?hl=en. >>>>> >>>> >>>> >>>> >>>> -- >>>> The Power to Believe in yourself, will become the power to change Fate. >>>> >>>> -- >>>> 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]<algogeeks%[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]<algogeeks%[email protected]> >>> . >>> For more options, visit this group at >>> http://groups.google.com/group/algogeeks?hl=en. >>> >> >> >> >> -- >> The Power to Believe in yourself, will become the power to change Fate. >> >> -- >> 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]<algogeeks%[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]<algogeeks%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- ------------------------------------------ * * k.vinay kumar>>>>Hunter -- 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.
